Module: Mongoid::ByStar
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/by_star/orm/mongoid/by_star.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#next(options = {}) ⇒ Object
58 59 60 61 |
# File 'lib/by_star/orm/mongoid/by_star.rb', line 58 def next(={}) field = self.class.by_star_start_field self.class.by_star_scope().gt(field => self.send(field)).asc(field).first end |
#previous(options = {}) ⇒ Object
53 54 55 56 |
# File 'lib/by_star/orm/mongoid/by_star.rb', line 53 def previous(={}) field = self.class.by_star_start_field self.class.by_star_scope().lt(field => self.send(field)).desc(field).first end |