Skip to content

Commit 67afff0

Browse files
author
Sean Floyd
committed
Fix options
1 parent 6633eff commit 67afff0

File tree

1 file changed

+2
-2
lines changed
  • elasticsearch-model/lib/elasticsearch/model/adapters

1 file changed

+2
-2
lines changed

elasticsearch-model/lib/elasticsearch/model/adapters/multiple.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def __records_for_klass(klass, ids)
7171
adapter = __adapter_for_klass(klass)
7272

7373
# Allow calling `.records()` with options:
74-
# klass.name => [{ method: :includes, args: [:association]}, { method: :scope_name }]
75-
if (klass_options = @options.dig(klass.name))
74+
# ex: `klass.name => [{ method: :includes, args: [:association]}, { method: :scope_name }]`
75+
if (klass_options = options&.dig(klass.name))
7676
klass_options.each { |opts| klass = klass.public_send(opts[:method], *opts[:args]) }
7777
end
7878

0 commit comments

Comments
 (0)