ruby on rails - Product.where(:tags => nil) returns empty results, yet it should have thousands of records -



ruby on rails - Product.where(:tags => nil) returns empty results, yet it should have thousands of records -

weird one. have model product.rb, have 10k products. have title, description, link, brand , tag columns. product.where(:tags => nil) doesn't work, not via console or via method in model.

is ridiculously simple i'm doing wrong?

(i haven't got code can include, literally simple 1 single command wont work :/)

thanks,

geoff

when product has no tags, store null values in tags column or store empty string? seek this:

product.where(:tags => "")

if doesn't work seek running these sql queries , tell results are:

select * products tags null; select * products tags = "";

ruby-on-rails

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -