Module: RocketJob::Plugins::Document::ClassMethods
- Defined in:
- lib/rocket_job/plugins/document.rb
Overview
rubocop:disable Style/RedundantSort
Instance Method Summary collapse
-
#first ⇒ Object
Mongoid does not apply ordering, add sort.
-
#last ⇒ Object
Mongoid does not apply ordering, add sort.
Instance Method Details
#first ⇒ Object
Mongoid does not apply ordering, add sort
17 18 19 |
# File 'lib/rocket_job/plugins/document.rb', line 17 def first all.sort("_id" => 1).first end |
#last ⇒ Object
Mongoid does not apply ordering, add sort
22 23 24 |
# File 'lib/rocket_job/plugins/document.rb', line 22 def last all.sort("_id" => -1).first end |