Module: Mongoid::Publishable::ClassMethods
- Defined in:
- lib/mongoid/publishable.rb
Instance Method Summary collapse
Instance Method Details
#drafts ⇒ Object
18 19 20 |
# File 'lib/mongoid/publishable.rb', line 18 def drafts where(:published_at => nil).desc(:published_at) end |
#published ⇒ Object
14 15 16 |
# File 'lib/mongoid/publishable.rb', line 14 def published where(:published_at => {'$lte' => Time.now}).desc(:published_at) end |
#scheduled ⇒ Object
10 11 12 |
# File 'lib/mongoid/publishable.rb', line 10 def scheduled where(:published_at => {'$gt' => Time.now}).asc(:published_at) end |