lib/mongoid/publish.rb in publish-0.1.1 vs lib/mongoid/publish.rb in publish-0.1.2

- old
+ new

@@ -3,12 +3,12 @@ extend ActiveSupport::Concern included do field :published_at, :type => Date field :published, :type => Boolean, :default => false - - scope :published, where(:published => true, :published_at.lte => Date.today) - scope :published_and_orderly, where(:published => true, :published_at.lte => Date.today).desc(:published_at, :created_at) + + scope :published, -> { where(:published => true, :published_at.lte => Date.today) } + scope :published_and_orderly, -> { where(:published => true, :published_at.lte => Date.today).desc(:published_at, :created_at) } before_save :set_published_at end include Mongoid::Publish::Callbacks \ No newline at end of file