close #566; Merge branch 'remove_deprecated_non_bang' [ci skip]

This commit is contained in:
Ben Atkins 2015-07-29 23:08:22 -04:00
commit bba433a42c
3 changed files with 6 additions and 42 deletions

View File

@ -29,6 +29,12 @@ candidates.
- `3da1f104` - `PaperTrail.config` and `PaperTrail.configure` are now
identical: both return the `PaperTrail::Config` instance and also
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

View File

@ -96,21 +96,11 @@ module PaperTrail
PaperTrail.enabled_for_model(self, false)
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.
def paper_trail_on!
PaperTrail.enabled_for_model(self, true)
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?
return false unless self.include?(PaperTrail::Model::InstanceMethods)
PaperTrail.enabled_for_model?(self)

View File

@ -282,21 +282,6 @@ describe Widget, :type => :model do
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
before { subject.paper_trail_off! }
@ -308,23 +293,6 @@ describe Widget, :type => :model do
expect(subject.paper_trail_enabled_for_model?).to be true
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