Merge pull request #984 from evmorov/master

Fixes uninitialized constant PaperTrail::RecordTrail::ActiveRecordError
This commit is contained in:
Jared Beck 2017-08-18 11:18:04 -04:00 committed by GitHub
commit 839d8c7af4
2 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
- Stop including unnecessary files in released gem. Reduces .gem file size
from 100K to 30K.
- [#984](https://github.com/airblade/paper_trail/pull/984) - Fix wrong
exception in `touch_with_version` if record object isn't persisted
## 7.1.0 (2017-07-09)

View File

@ -399,7 +399,7 @@ module PaperTrail
# leverage an `after_update` callback anyways (likely for v4.0.0)
def touch_with_version(name = nil)
unless @record.persisted?
raise ActiveRecordError, "can not touch on a new record object"
raise ::ActiveRecord::ActiveRecordError, "can not touch on a new record object"
end
attributes = @record.send :timestamp_attributes_for_update_in_model
attributes << name if name