diff --git a/lib/active_remote/association.rb b/lib/active_remote/association.rb index 6493b31..d01511d 100644 --- a/lib/active_remote/association.rb +++ b/lib/active_remote/association.rb @@ -39,7 +39,7 @@ def belongs_to(belongs_to_klass, options = {}) search_hash[:guid] = object.send(foreign_key) search_hash[options[:scope]] = object.send(options[:scope]) if options.key?(:scope) - search_hash.values.any?(&:nil?) ? nil : klass.search(search_hash).first + search_hash.values.any?(&:nil?) ? nil : klass.search(**search_hash).first end end @@ -80,7 +80,7 @@ def has_many(has_many_class, options = {}) search_hash[foreign_key] = object.guid search_hash[options[:scope]] = object.send(options[:scope]) if options.key?(:scope) - search_hash.values.any?(&:nil?) ? [] : klass.search(search_hash) + search_hash.values.any?(&:nil?) ? [] : klass.search(**search_hash) end options[:has_many] = true @@ -120,7 +120,7 @@ def has_one(has_one_klass, options = {}) search_hash[foreign_key] = object.guid search_hash[options[:scope]] = object.send(options[:scope]) if options.key?(:scope) - search_hash.values.any?(&:nil?) ? nil : klass.search(search_hash).first + search_hash.values.any?(&:nil?) ? nil : klass.search(**search_hash).first end end diff --git a/spec/lib/active_remote/persistence_spec.rb b/spec/lib/active_remote/persistence_spec.rb index bfd6212..a4fdeda 100644 --- a/spec/lib/active_remote/persistence_spec.rb +++ b/spec/lib/active_remote/persistence_spec.rb @@ -351,7 +351,7 @@ end it "updates a remote record" do - expect(rpc).to receive(:execute).with(:update, "name" => "foo", "guid" => "123") + expect(rpc).to receive(:execute).with(:update, {"name" => "foo", "guid" => "123"}) tag.update_attribute(:name, "foo") end