Created
July 21, 2009 16:42
-
-
Save curtis/151452 to your computer and use it in GitHub Desktop.
An example of using named scope inside a plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
named_scope :archived, lambda { { :conditions => ["archived_at IS NOT NULL AND archived_at <= ?", Time.now.utc] } } | |
named_scope :not_archived, lambda { { :conditions => ["archived_at IS NULL OR archived_at > ?", Time.now.utc] } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment