Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:tog/tog_headlines
Browse files Browse the repository at this point in the history
  • Loading branch information
molpe committed Jun 11, 2009
2 parents bf9b4c5 + 8d776b6 commit 0ce7c1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/story.rb
Expand Up @@ -10,11 +10,11 @@ class Story < ActiveRecord::Base
belongs_to :owner, :class_name => "User", :foreign_key => "user_id"

named_scope :draft, :conditions => ['state = ?', 'draft']
named_scope :archived, :conditions => ['archive_date <= ?', Date.today]
named_scope :published, :conditions => ['publish_date <= ? and archive_date > ?', Date.today, Date.today]


named_scope :archived, lambda { |*args| { :conditions => ['archive_date <= ?', args.first || Date.today] } }
named_scope :published, lambda { |*args| { :conditions => ['publish_date <= ? and archive_date > ?', args.first || Date.today, args.last || Date.today] } }

named_scope :site, :conditions => ['portal = ?', true]


validates_presence_of :title, :body

Expand Down

0 comments on commit 0ce7c1f

Please sign in to comment.