Skip to content

Commit

Permalink
added ruby-3.1 compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
skunkworker authored and liveh2o committed Jun 15, 2024
1 parent ffe0e47 commit 9477268
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/active_remote/association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/active_remote/persistence_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9477268

Please sign in to comment.