We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4ec07b commit 10640caCopy full SHA for 10640ca
elasticsearch-model/lib/elasticsearch/model/adapters/multiple.rb
@@ -70,6 +70,12 @@ def __records_by_type
70
def __records_for_klass(klass, ids)
71
adapter = __adapter_for_klass(klass)
72
73
+ # Allow calling `.records()` with options:
74
+ # klass.name => [{ method: :includes, args: [:association]}, { method: :scope_name }]
75
+ if (klass_options = @options.dig(klass.name))
76
+ klass_options.each { klass = klass.public_send(_1[:method], *_1[:args]) }
77
+ end
78
+
79
case
80
when Elasticsearch::Model::Adapter::ActiveRecord.equal?(adapter)
81
klass.where(klass.primary_key => ids)
0 commit comments