I want to find records with multiple conditions and this is my code:
@calhappybd = Client.where(:user_id => current_user.id, "birth IS NOT NULL")
I'm tr开发者_Go百科ying to do this with squeel-gem, but when I try to use multiple conditions (where{(cond1)(cond2)}), but my current_user.id defined as simple string-data.
With squeel, you should be able to do something like
@calhappybd = Client.where{(user_id == current_user.id) & (birth != nil)}
Let know if you get the same error again...
UPDATED:
Modified the conditions above. Note the single ampersand and double equals. That works for me..
My configuration:
rails 3.1.0.rc6
squeel 0.8.8
精彩评论