diff --git a/lib/searchkick/index.rb b/lib/searchkick/index.rb index 3ef078c..4e31bc3 100644 --- a/lib/searchkick/index.rb +++ b/lib/searchkick/index.rb @@ -199,20 +199,13 @@ module Searchkick refresh = options.fetch(:refresh, !scoped) options.delete(:refresh) - if method_name + if method_name || (scoped && !full) raise ArgumentError, "unsupported keywords: #{options.keys.map(&:inspect).join(", ")}" if options.any? - # update + # import only import_scope(relation, method_name: method_name, scope: scope) self.refresh if refresh true - elsif scoped && !full - raise ArgumentError, "unsupported keywords: #{options.keys.map(&:inspect).join(", ")}" if options.any? - - # reindex association - import_scope(relation, scope: scope) - self.refresh if refresh - true else # full reindex reindex_scope(relation, scope: scope, **options) -- libgit2 0.21.0