Removed deprecated Version#originator

This commit is contained in:
Jared Beck 2017-12-10 21:29:49 -05:00
parent 582770c2f4
commit 39f31ca895
3 changed files with 1 additions and 24 deletions

View File

@ -7,8 +7,7 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
### Breaking Changes
- [#479](https://github.com/airblade/paper_trail/issues/479) - Deprecated
`originator` method, use `paper_trail_originator`
- Removed deprecated `Version#originator`, use `#paper_trail_originator`
- Using paper_trail.on_destroy(:after) with ActiveRecord's
belongs_to_required_by_default will produce an error instead of a warning.
- Failing to set PaperTrail.config.track_associations will no longer produce

View File

@ -230,11 +230,6 @@ module PaperTrail
@paper_trail_originator ||= previous.try(:whodunnit)
end
def originator
::ActiveSupport::Deprecation.warn "Use paper_trail_originator instead of originator."
paper_trail_originator
end
# Returns who changed the item from the state it had in this version. This
# is an alias for `whodunnit`.
def terminator

View File

@ -65,23 +65,6 @@ module PaperTrail
end
end
describe "#originator" do
it "delegates to paper_trail_originator" do
allow(ActiveSupport::Deprecation).to receive(:warn)
version = PaperTrail::Version.new
allow(version).to receive(:paper_trail_originator)
version.originator
expect(version).to have_received(:paper_trail_originator)
end
it "displays a deprecation warning" do
allow(ActiveSupport::Deprecation).to receive(:warn)
PaperTrail::Version.new.originator
expect(ActiveSupport::Deprecation).to have_received(:warn).
with(/Use paper_trail_originator instead of originator/)
end
end
describe "#terminator" do
it "is an alias for the `whodunnit` attribute" do
attributes = { whodunnit: FFaker::Name.first_name }