John Duu wrote:
> conditions = {:org => ["ABC", "XYZ", "NULL"]}
> Defect.count :conditions => conditions
>
> Don't know what to do if the org name really is "NULL".
The string "NULL" is not the same as a NULL value in a field. I doubt
what you're showing here will generate the proper SQL as shown earlier
by pepe:
pepe wrote:
> conditions = "org is null or org in ('ABC', 'XYZ')"
You need to actually check the generated SQL in your development log to
make sure it looks something like the above.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.