diff --git a/CHANGELOG.md b/CHANGELOG.md index 8641abe5..f80bf631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/lib/paper_trail/record_trail.rb b/lib/paper_trail/record_trail.rb index cec29cfe..b0f5f97e 100644 --- a/lib/paper_trail/record_trail.rb +++ b/lib/paper_trail/record_trail.rb @@ -474,7 +474,9 @@ module PaperTrail 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