close #566; Merge branch 'remove_deprecated_non_bang' [ci skip]
This commit is contained in:
commit
bba433a42c
|
@ -30,6 +30,12 @@ candidates.
|
||||||
identical: both return the `PaperTrail::Config` instance and also
|
identical: both return the `PaperTrail::Config` instance and also
|
||||||
yield it if a block is provided.
|
yield it if a block is provided.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- [#566](https://github.com/airblade/paper_trail/pull/566) - Removed deprecated
|
||||||
|
methods `paper_trail_on` and `paper_trail_off`. Use `paper_trail_on!` and
|
||||||
|
`paper_trail_off!` instead.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- [#525](https://github.com/airblade/paper_trail/issues/525) /
|
- [#525](https://github.com/airblade/paper_trail/issues/525) /
|
||||||
|
|
|
@ -96,21 +96,11 @@ module PaperTrail
|
||||||
PaperTrail.enabled_for_model(self, false)
|
PaperTrail.enabled_for_model(self, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
def paper_trail_off
|
|
||||||
warn "DEPRECATED: use `paper_trail_off!` instead of `paper_trail_off`. Support for `paper_trail_off` will be removed in PaperTrail 4.0"
|
|
||||||
self.paper_trail_off!
|
|
||||||
end
|
|
||||||
|
|
||||||
# Switches PaperTrail on for this class.
|
# Switches PaperTrail on for this class.
|
||||||
def paper_trail_on!
|
def paper_trail_on!
|
||||||
PaperTrail.enabled_for_model(self, true)
|
PaperTrail.enabled_for_model(self, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def paper_trail_on
|
|
||||||
warn "DEPRECATED: use `paper_trail_on!` instead of `paper_trail_on`. Support for `paper_trail_on` will be removed in PaperTrail 4.0"
|
|
||||||
self.paper_trail_on!
|
|
||||||
end
|
|
||||||
|
|
||||||
def paper_trail_enabled_for_model?
|
def paper_trail_enabled_for_model?
|
||||||
return false unless self.include?(PaperTrail::Model::InstanceMethods)
|
return false unless self.include?(PaperTrail::Model::InstanceMethods)
|
||||||
PaperTrail.enabled_for_model?(self)
|
PaperTrail.enabled_for_model?(self)
|
||||||
|
|
|
@ -282,21 +282,6 @@ describe Widget, :type => :model do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#paper_trail_off' do
|
|
||||||
it { is_expected.to respond_to(:paper_trail_off) }
|
|
||||||
|
|
||||||
it 'should set the invoke `paper_trail_off!`' do
|
|
||||||
is_expected.to receive(:warn)
|
|
||||||
is_expected.to receive(:paper_trail_off!)
|
|
||||||
subject.paper_trail_off
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should display a deprecation warning' do
|
|
||||||
is_expected.to receive(:warn).with("DEPRECATED: use `paper_trail_on!` instead of `paper_trail_on`. Support for `paper_trail_on` will be removed in PaperTrail 4.0")
|
|
||||||
subject.paper_trail_on
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#paper_trail_on!' do
|
describe '#paper_trail_on!' do
|
||||||
before { subject.paper_trail_off! }
|
before { subject.paper_trail_off! }
|
||||||
|
|
||||||
|
@ -308,23 +293,6 @@ describe Widget, :type => :model do
|
||||||
expect(subject.paper_trail_enabled_for_model?).to be true
|
expect(subject.paper_trail_enabled_for_model?).to be true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#paper_trail_on' do
|
|
||||||
before { subject.paper_trail_off! }
|
|
||||||
|
|
||||||
it { is_expected.to respond_to(:paper_trail_on) }
|
|
||||||
|
|
||||||
it 'should set the invoke `paper_trail_on!`' do
|
|
||||||
is_expected.to receive(:warn)
|
|
||||||
is_expected.to receive(:paper_trail_on!)
|
|
||||||
subject.paper_trail_on
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should display a deprecation warning' do
|
|
||||||
is_expected.to receive(:warn).with("DEPRECATED: use `paper_trail_on!` instead of `paper_trail_on`. Support for `paper_trail_on` will be removed in PaperTrail 4.0")
|
|
||||||
subject.paper_trail_on
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue