Module: Pagy::ElasticsearchRailsExtra::ElasticsearchRails

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#pagy_elasticsearch_rails(query_or_payload, **options) ⇒ Object

Return 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 optional method call.



26
27
28
29
30
# File 'lib/pagy/extras/elasticsearch_rails.rb', line 26

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