Skip to content

Commit

Permalink
add support for Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Jan 10, 2021
1 parent e023732 commit 713b088
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.0"

- name: Build
run: |
Expand All @@ -31,8 +31,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.7"]
activemodel: ["6.1", "6.0", "5.2", "5.1", "5.0"]
ruby: ["3.0"]
activemodel: ["6.1", "6.0"]
include:
- activemodel: "5.2"
ruby: "2.7"
- activemodel: "5.1"
ruby: "2.7"
- activemodel: "5.0"
ruby: "2.7"

steps:
- uses: actions/checkout@v2
Expand All @@ -58,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.6", "2.5", "jruby-9.2.11.1"]
ruby: ["2.7", "2.6", "2.5", "jruby-9.2.11.1"]
activemodel: ["5.2"]

steps:
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Changed

- drop support for Ruby < 2.5
- drop support for Rails < 5.0
- drop support for Ruby < 2.5, added support for Ruby 3.0
- drop support for Rails < 5.0, added support for Rails 6.1
- [#398][] - Predicate methods have been removed.
([how to upgrade](#predicate-methods))
- [#412][] - Filters will now treat blank string values as `nil`
Expand Down
4 changes: 2 additions & 2 deletions lib/active_interaction/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ def populate_filters(inputs)

def type_check
run_callbacks(:type_check) do
Validation.validate(self, self.class.filters, inputs).each do |error|
errors.add(*error)
Validation.validate(self, self.class.filters, inputs).each do |attr, type, kwargs = {}|
errors.add(attr, type, **kwargs)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_interaction/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def merge_detail!(attribute, detail, message)
options = detail.dup
error = options.delete(:error)

add(attribute, error, options.merge(message: message)) unless added?(attribute, error, options)
add(attribute, error, **options.merge(message: message)) unless added?(attribute, error, **options)
else
merge_message!(attribute, message)
end
Expand Down

0 comments on commit 713b088

Please sign in to comment.