Skip to content

Instantly share code, notes, and snippets.

@dirkkelly
Created December 29, 2010 03:44
Show Gist options
  • Save dirkkelly/758133 to your computer and use it in GitHub Desktop.
Save dirkkelly/758133 to your computer and use it in GitHub Desktop.
Using 2.3.x named_scopes for @mariovisic drafting question
class Version
named_scope :drafts, :conditions => { :draft => true }
named_scope :published, :conditions => { :draft => false }
end
Version.drafts # all drafts
Version.published # all published
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment