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

drop support for deprecated rails versions #431

Merged
merged 1 commit into from
Apr 4, 2018
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
14 changes: 0 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ before_install:
- "travis_retry gem update --system"
- "travis_retry gem install bundler"
gemfile:
- gemfiles/rails40.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
- gemfiles/rails50.gemfile
- gemfiles/rails51.gemfile
Expand All @@ -34,18 +32,6 @@ matrix:
gemfile: gemfiles/rails51.gemfile
- rvm: 2.1
gemfile: gemfiles/rails52.gemfile
- rvm: 2.4.3
gemfile: gemfiles/rails40.gemfile
- rvm: 2.4.3
gemfile: gemfiles/rails41.gemfile
- rvm: 2.5.0
gemfile: gemfiles/rails40.gemfile
- rvm: 2.5.0
gemfile: gemfiles/rails41.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails40.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails41.gemfile
fast_finish: true
branches:
only:
Expand Down
11 changes: 0 additions & 11 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
appraise 'rails40' do
gem 'rails', '~> 4.0.0'
gem 'protected_attributes'
gem 'test-unit'
end

appraise 'rails41' do
gem 'rails', '~> 4.1.0'
gem 'protected_attributes'
end

appraise 'rails42' do
gem 'rails', '~> 4.2.0'
gem 'protected_attributes'
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Breaking changes
- removed `audited_columns`, `non_audited_columns`, `auditing_enabled=` instance methods,
use class methods instead
[#424](https://github.com/collectiveidea/audited/pull/424)
- removed rails 4.1 and 4.0 support
[#431](https://github.com/collectiveidea/audited/pull/431)

Added

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Audited [![Build Status](https://secure.travis-ci.org/collectiveidea/audited.svg

**Audited** (previously acts_as_audited) is an ORM extension that logs all changes to your models. Audited can also record who made those changes, save comments and associate models related to the changes.

Audited currently (4.x) works with Rails 5.1, 5.0 and 4.2. It may work with 4.1 and 4.0, but this is not guaranteed.
Audited currently (4.x) works with Rails 5.1, 5.0 and 4.2.

For Rails 3, use gem version 3.0 or see the [3.0-stable branch](https://github.com/collectiveidea/audited/tree/3.0-stable).

Expand Down
5 changes: 2 additions & 3 deletions audited.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ Gem::Specification.new do |gem|
gem.license = 'MIT'

gem.files = `git ls-files`.split($\).reject{|f| f =~ /(\.gemspec)/ }
gem.require_paths = ['lib']

gem.add_dependency 'activerecord', '>= 4.0', '< 5.2'
gem.add_dependency 'activerecord', '>= 4.2', '< 5.2'

gem.add_development_dependency 'appraisal'
gem.add_development_dependency 'rails', '>= 4.0', '< 5.2'
gem.add_development_dependency 'rails', '>= 4.2', '< 5.2'
gem.add_development_dependency 'rspec-rails', '~> 3.5'

# JRuby support for the test ENV
Expand Down
9 changes: 0 additions & 9 deletions gemfiles/rails40.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails41.gemfile

This file was deleted.

5 changes: 0 additions & 5 deletions lib/audited/auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def combine_audits(audits_to_combine)
def revision_with(attributes)
dup.tap do |revision|
revision.id = id
revision.send :instance_variable_set, '@attributes', self.attributes if rails_below?('4.2.0')
revision.send :instance_variable_set, '@new_record', destroyed?
revision.send :instance_variable_set, '@persisted', !destroyed?
revision.send :instance_variable_set, '@readonly', false
Expand All @@ -185,10 +184,6 @@ def revision_with(attributes)
end
end

def rails_below?(rails_version)
Gem::Version.new(Rails::VERSION::STRING) < Gem::Version.new(rails_version)
end

private

def audited_changes
Expand Down
2 changes: 1 addition & 1 deletion spec/audited/auditor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def non_column_attr=(val)
expect(user.audits.last.audited_changes.keys).to eq(%w{non_column_attr})
end

if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' && Rails.version >= "4.2.0.0" # Postgres json and jsonb support was added in Rails 4.2
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
describe "'json' and 'jsonb' audited_changes column type" do
let(:migrations_path) { SPEC_ROOT.join("support/active_record/postgres") }

Expand Down