From 4395a30c8b274bffa36b367e925def49ef34163e Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Sun, 12 Jul 2015 23:29:31 -0400 Subject: [PATCH 1/3] Remove deprecated: paper_trail_on, paper_trail_off --- CHANGELOG.md | 3 +++ lib/paper_trail/has_paper_trail.rb | 10 ---------- spec/models/widget_spec.rb | 32 ------------------------------ 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e22cd1..49932215 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ candidates. https://github.com/airblade/paper_trail/pull/492. - If you depend on the `RSpec` or `Cucumber` helpers, you must [require them in your test helper](https://github.com/airblade/paper_trail#testing). +- [#577](https://github.com/airblade/paper_trail/pull/577) - Removed deprecated + methods `paper_trail_on` and `paper_trail_off`. Use `paper_trail_on!` and + `paper_trail_off!` instead. - [#458](https://github.com/airblade/paper_trail/pull/458) - Version metadata (the `:meta` option) from AR attributes for `create` events will now save the current value instead of `nil`. diff --git a/lib/paper_trail/has_paper_trail.rb b/lib/paper_trail/has_paper_trail.rb index b6d0b0c8..89f2cda5 100644 --- a/lib/paper_trail/has_paper_trail.rb +++ b/lib/paper_trail/has_paper_trail.rb @@ -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) diff --git a/spec/models/widget_spec.rb b/spec/models/widget_spec.rb index 71aec412..55908175 100644 --- a/spec/models/widget_spec.rb +++ b/spec/models/widget_spec.rb @@ -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 From b18f1863cc955d74462aa489527ccb9f95d40b53 Mon Sep 17 00:00:00 2001 From: Ben Atkins Date: Wed, 29 Jul 2015 22:36:38 -0400 Subject: [PATCH 2/3] Update Changelog release notes for 4.0 to contain a 'Removed' section --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49932215..38aec8f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,9 +13,6 @@ candidates. https://github.com/airblade/paper_trail/pull/492. - If you depend on the `RSpec` or `Cucumber` helpers, you must [require them in your test helper](https://github.com/airblade/paper_trail#testing). -- [#577](https://github.com/airblade/paper_trail/pull/577) - Removed deprecated - methods `paper_trail_on` and `paper_trail_off`. Use `paper_trail_on!` and - `paper_trail_off!` instead. - [#458](https://github.com/airblade/paper_trail/pull/458) - Version metadata (the `:meta` option) from AR attributes for `create` events will now save the current value instead of `nil`. @@ -32,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 + +- [#577](https://github.com/airblade/paper_trail/pull/577) - Removed deprecated + methods `paper_trail_on` and `paper_trail_off`. Use `paper_trail_on!` and + `paper_trail_off!` instead. ### Added From 374f508d1e4b8bae1b2c07b5f13a423ea9cf4bc3 Mon Sep 17 00:00:00 2001 From: Ben Atkins Date: Wed, 29 Jul 2015 23:07:59 -0400 Subject: [PATCH 3/3] Update CHANGELOG regarding removal of non bang on/off methods so the linked PR # is correct [ci skip] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38aec8f2..e8e69df7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ candidates. ### Removed -- [#577](https://github.com/airblade/paper_trail/pull/577) - Removed deprecated +- [#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.