On Oct 1, 6:27 am, Greg King <rails-mailing-l...@andreas-s.net> wrote:
> I'm rails a newbie:
>
> I have a form setup where users selects datetime, the datetime serves
> the purpose of allowing the user to specify when the entry expires. In
> efforts to filter entrys that have an earlier datetime than now I am
> using the following:
>
> def self.find_active
> find(:all, :conditions => ['expiration > ?', DateTime.now])
>
You've got your condition back to front - that returns entries whose
expiry is after now
Fred
> It does not filter out the expiration inputs that are further in advance
> than DateTime.now
>
> Any help would be greatly appreciated :)
> --
> Posted viahttp://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 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
-~----------~----~----~----~------~----~------~--~---