Find conditions

Rails Newb wrote:

def self.find_active     find(:all, :conditions => ['expiration > ?', DateTime.now])

On a side note: Wouldn't this be a good candidate for a named_scope rather than a class method?

named_scope :active, lamda { :conditions => [ 'expiration > ?', DateTime.now ] }

or

named_scope :active, lamda { :conditions => [ 'expiration <= ?', DateTime.now ] }

or whatever conditions you determine are the right ones for your case.

P.S. This would be more conventional to the Rails framework:

named_scope :active, lamda { :conditions => [ 'expires_at > ?', DateTime.now ] }

where expires_at is a datetime column in the database.