Removed deprecated Version#originator
This commit is contained in:
parent
582770c2f4
commit
39f31ca895
|
@ -7,8 +7,7 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
||||||
- [#479](https://github.com/airblade/paper_trail/issues/479) - Deprecated
|
- Removed deprecated `Version#originator`, use `#paper_trail_originator`
|
||||||
`originator` method, use `paper_trail_originator`
|
|
||||||
- Using paper_trail.on_destroy(:after) with ActiveRecord's
|
- Using paper_trail.on_destroy(:after) with ActiveRecord's
|
||||||
belongs_to_required_by_default will produce an error instead of a warning.
|
belongs_to_required_by_default will produce an error instead of a warning.
|
||||||
- Failing to set PaperTrail.config.track_associations will no longer produce
|
- Failing to set PaperTrail.config.track_associations will no longer produce
|
||||||
|
|
|
@ -230,11 +230,6 @@ module PaperTrail
|
||||||
@paper_trail_originator ||= previous.try(:whodunnit)
|
@paper_trail_originator ||= previous.try(:whodunnit)
|
||||||
end
|
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
|
# Returns who changed the item from the state it had in this version. This
|
||||||
# is an alias for `whodunnit`.
|
# is an alias for `whodunnit`.
|
||||||
def terminator
|
def terminator
|
||||||
|
|
|
@ -65,23 +65,6 @@ module PaperTrail
|
||||||
end
|
end
|
||||||
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
|
describe "#terminator" do
|
||||||
it "is an alias for the `whodunnit` attribute" do
|
it "is an alias for the `whodunnit` attribute" do
|
||||||
attributes = { whodunnit: FFaker::Name.first_name }
|
attributes = { whodunnit: FFaker::Name.first_name }
|
||||||
|
|
Loading…
Reference in New Issue