Skip to content

Commit

Permalink
drop support for Rails < 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Jan 10, 2021
1 parent b677807 commit 4e6edb2
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 118 deletions.
17 changes: 3 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,13 @@ matrix:
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-5.0.rb
rvm: 2.7
# Latest Usable MRI, ActiveModel 4.2, RSpec only
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-4.2.rb
rvm: 2.3
# Latest Usable MRI, ActiveModel 4.1, RSpec only
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-4.1.rb
rvm: 2.3
# Latest Usable MRI, ActiveModel 4.0, RSpec only
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-4.0.rb
rvm: 2.3

# These test specific versions of MRI that we support.
# MRI 2.5, ActiveModel 5.1, RSpec only
# MRI 2.6, ActiveModel 5.1, RSpec only
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-5.1.rb
rvm: 2.6
# MRI 2.5, ActiveModel 5.1, RSpec only
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-5.1.rb
rvm: 2.5
Expand All @@ -50,7 +39,7 @@ matrix:
rvm: 2.4

# These test other Ruby implementations that we support.
# JRuby 9, ActiveModel 6.0, RSpec only
# JRuby 9, ActiveModel 5.2, RSpec only
- env: RAKE_TASK=spec
gemfile: gemfiles/activemodel-5.2.rb
rvm: jruby-9.2.7.0
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Changed

- drop support for Ruby 2.0, 2.1, and 2.2
- drop suport for Rails < 5.0
- [#392][] - Integer parsing now defaults the base to 10. ([how to upgrade](#integer-parsing-base-now-10))
- The `inputs` method now returns an `ActiveInteraction::Input` instead of a
hash. The `ActiveInteraction::Input` still responds to all hash methods.
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1177,9 +1177,6 @@ def execute
end
```

These types of errors are standard as of Rails 5. ActiveInteraction's
implementation is based off of [active_model-errors_details][].

ActiveInteraction also supports merging errors. This is useful if you want to
delegate validation to some other object. For example, if you have an
interaction that updates a record, you might want that record to validate
Expand Down
2 changes: 1 addition & 1 deletion active_interaction.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
Dir.glob(File.join('lib', 'active_interaction', 'locale', '*.yml'))
gem.test_files = Dir.glob(File.join('spec', '**', '*.rb'))

gem.add_dependency 'activemodel', '>= 4', '< 7'
gem.add_dependency 'activemodel', '>= 5', '< 7'

{
'actionpack' => [],
Expand Down
7 changes: 0 additions & 7 deletions gemfiles/activemodel-4.0.rb

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/activemodel-4.1.rb

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/activemodel-4.2.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/active_interaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ module ActiveInteraction

require 'active_interaction/base'

require 'active_interaction/backports'

I18n.load_path.unshift(
*Dir.glob(
File.expand_path(
Expand Down
58 changes: 0 additions & 58 deletions lib/active_interaction/backports.rb

This file was deleted.

19 changes: 0 additions & 19 deletions spec/active_interaction/errors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ def self.name

subject(:errors) { described_class.new(klass.new) }

context 'backports' do
describe '#delete' do
it 'deletes the detailed error' do
errors.add(:attribute)
errors.delete(:attribute)
expect(errors.details).to_not have_key :attribute
end
end

describe '#initialize_dup' do
it 'duplicates the detailed errors' do
errors.add(:attribute)
other = errors.dup
expect(other.details).to eql errors.details
expect(other.details).to_not be errors.details
end
end
end

describe '#merge!' do
let(:other) { described_class.new(klass.new) }

Expand Down

0 comments on commit 4e6edb2

Please sign in to comment.