Class: Wor::Paginate::Utils::PreserveRecordsHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/wor/paginate/utils/preserve_records_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(content, url, options) ⇒ PreserveRecordsHelper

Returns a new instance of PreserveRecordsHelper.



8
9
10
11
12
# File 'lib/wor/paginate/utils/preserve_records_helper.rb', line 8

def initialize(content, url, options)
  @content = content
  @url = url
  @options = options
end

Instance Method Details

#callObject



14
15
16
17
# File 'lib/wor/paginate/utils/preserve_records_helper.rb', line 14

def call
  [content.where("#{field} <= :last_value", last_value: last_value),
   UriHelper.replace_query_params(url, query_param_name => last_value)]
end