Obtaining ActiveRecords if NOT nil

Posted by user275729 on Stack Overflow See other posts from Stack Overflow or by user275729
Published on 2010-06-02T15:41:29Z Indexed on 2010/06/02 15:44 UTC
Read the original article Hit count: 204

Filed under:
|
|
|

I would like to be able to gather all records in a table where the user_id is not null. This is what I have but it doesn't seem to be working (even though I've had it working in a seperate project):

named_scope :all_registered, :conditions => ["user_id != ?", nil]

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby