Skip to content

Commit

Permalink
Merge pull request #936 from airblade/followup_to_pr_929
Browse files Browse the repository at this point in the history
Fix tests, and fix error calling private method in rails 4.0
  • Loading branch information
jaredbeck authored Mar 7, 2017
2 parents fa70dbf + 7cbb6fe commit 77e74a4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
9 changes: 0 additions & 9 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require:
- rubocop-rspec
- rubocop-thread_safety

inherit_from: .rubocop_todo.yml

Expand Down Expand Up @@ -109,11 +108,3 @@ Style/StringLiterals:
# because it makes the code harder to edit, and makes lines unnecessarily long.
Style/SpaceAroundOperators:
AllowForAlignment: false

ThreadSafety/NewThread:
Exclude:
- 'test/functional/thread_safety_test.rb'

ThreadSafety/InstanceVariableInClassMethod:
Exclude:
- 'lib/paper_trail.rb'
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ before_script:
- sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database paper_trail_foo;' -U postgres; fi"

gemfile:
- gemfiles/ar_4.0.gemfile
- gemfiles/ar_4.2.gemfile
- gemfiles/ar_5.0.gemfile
- gemfiles/ar_master.gemfile
Expand Down
5 changes: 5 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
# > the version from the appraisal takes precedence.
# > https://github.com/thoughtbot/appraisal

appraise "ar-4.0" do
gem "activerecord", "~> 4.0"
gem "sinatra", "~> 1.4.6"
end

appraise "ar-4.2" do
gem "activerecord", "~> 4.2"
gem "sinatra", "~> 1.4.6"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).

- [#925](https://github.com/airblade/paper_trail/pull/925) - Update RSpec
matchers to work with custom version association names
- [#929](https://github.com/airblade/paper_trail/pull/929) -
Fix error calling private method in rails 4.0

## 6.0.2 (2016-12-13)

Expand Down
8 changes: 8 additions & 0 deletions gemfiles/ar_4.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", "~> 4.0"
gem "sinatra", "~> 1.4.6"

gemspec :path => "../"
4 changes: 3 additions & 1 deletion lib/paper_trail/record_trail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ def attribute_in_previous_version(attr_name)
if @in_after_callback && RAILS_GTE_5_1
@record.attribute_before_last_save(attr_name.to_s)
else
@record.attribute_was(attr_name.to_s)
# TODO: after dropping support for rails 4.0, remove send, because
# attribute_was is no longer private.
@record.send(:attribute_was, attr_name.to_s)
end
end

Expand Down
3 changes: 1 addition & 2 deletions paper_trail.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ has been destroyed.
s.add_development_dependency "generator_spec", "~> 0.9.3"
s.add_development_dependency "database_cleaner", "~> 1.2"
s.add_development_dependency "pry-nav", "~> 0.2.4"
s.add_development_dependency "rubocop", "~> 0.41.1"
s.add_development_dependency "rubocop", "~> 0.41.2"
s.add_development_dependency "rubocop-rspec", "~> 1.5.1"
s.add_development_dependency "rubocop-thread_safety", "~> 0.3.1"
s.add_development_dependency "timecop", "~> 0.8.0"
s.add_development_dependency "sqlite3", "~> 1.2"
s.add_development_dependency "pg", "~> 0.19.0"
Expand Down

0 comments on commit 77e74a4

Please sign in to comment.