What is the rails activerecord
syntax for select records with an empty field? For example, I want to find all the records that the middle_name
field is empty (length of the string < 1) for a user
database. Thanks!
views:
39answers:
1
A:
User.find(:all, :conditions=>["middle_name is ? or middle_name = ?", nil, ''])
Salil
2010-06-30 07:38:53