Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ruby-3.1 compatibility #97

Merged
merged 2 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Ruby CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7, head, debug, jruby-9.3, jruby-9.4, jruby-head, truffleruby, truffleruby-head]
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: ${{ matrix.ruby }}
- run: bundle install
- run: bundle rspec
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