Module: Pagy::ElasticsearchRails

Defined in:
lib/pagy/extras/elasticsearch_rails.rb

Instance Method Summary collapse

Instance Method Details

#pagy_elasticsearch_rails(query_or_payload, **options) ⇒ Object

returns an array used to delay the call of #search after the pagination variables are merged to the options it also pushes to the same array an eventually called method



13
14
15
16
17
# File 'lib/pagy/extras/elasticsearch_rails.rb', line 13

def pagy_elasticsearch_rails(query_or_payload, **options)
  [self, query_or_payload, options].tap do |args|
    args.define_singleton_method(:method_missing){|*a| args += a}
  end
end