app/models/post.rb in engrave-0.0.4 vs app/models/post.rb in engrave-0.0.5
- old
+ new
@@ -1,9 +1,10 @@
class Post < ActiveRecord::Base
belongs_to :author
attr_accessible :body, :draft, :published_at, :slug, :story_link, :title
- scope :published, where( [ "draft = ? AND published_at < ?", false, Time.now ] ).order( 'published_at DESC' )
+ scope :published, lambda { where( [ "draft = ? AND published_at < ?", false, Time.now ] ).order( 'published_at DESC' ) }
+
scope :draft, where( :draft => true )
extend ::FriendlyId
friendly_id :title, use: :slugged
end