Fix error calling private method in rails 4.0

This commit is contained in:
Jared Beck 2017-03-07 13:23:51 -05:00
parent fa70dbf069
commit d95de0906c
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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