Module: OrderQuery
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/order_query.rb,
lib/order_query/point.rb,
lib/order_query/space.rb,
lib/order_query/column.rb,
lib/order_query/errors.rb,
lib/order_query/version.rb,
lib/order_query/direction.rb,
lib/order_query/sql/where.rb,
lib/order_query/sql/column.rb,
lib/order_query/sql/order_by.rb,
lib/order_query/nulls_direction.rb
Overview
This gem finds the next or previous record(s) relative to the current one efficiently using keyset pagination, e.g. for navigation or infinite scroll.
Defined Under Namespace
Modules: ClassMethods, Direction, Errors, NullsDirection, SQL Classes: Column, Point, Space
Constant Summary collapse
- VERSION =
'0.5.3'
Class Attribute Summary collapse
-
.wrap_top_level_or ⇒ Object
Returns the value of attribute wrap_top_level_or.
Instance Method Summary collapse
Class Attribute Details
.wrap_top_level_or ⇒ Object
Returns the value of attribute wrap_top_level_or.
86 87 88 |
# File 'lib/order_query.rb', line 86 def wrap_top_level_or @wrap_top_level_or end |
Instance Method Details
#seek(*spec) ⇒ OrderQuery::Point
21 22 23 24 25 26 27 28 29 |
# File 'lib/order_query.rb', line 21 def seek(*spec) fst = spec.first if fst.nil? || fst.is_a?(ActiveRecord::Relation) || fst.is_a?(ActiveRecord::Base) scope = spec.shift end scope ||= self.class.all scope.seek(*spec).at(self) end |