Hey Group,

I am trying to use [what I thought should be] a simple scope for a message object

  scope :unread, where(:read_at => nil)

where the read_at attribute is of type datetime

This is causing the scope to trip a no method error when called upon.

I have a helper method  which contains :

if message.read_at == nil
      "NEW"
end

and that works fine. however even

 scope :unread, where("read_at == ?", nil )

does not seem to want to work.

I know I must be missing something terribly obvious about this. Any kick in the right direction is appreciated.

Thanks

Jesse

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to