Permalink
Browse files

Remove deprecated :set_whodunnit method from Rails::Controller module

  • Loading branch information...
1 parent 498e039 commit 4f6c57550b3ea62e1fe0e2af84b14dd3207de25a @batter batter committed Dec 2, 2013
Showing with 5 additions and 10 deletions.
  1. +1 −0 CHANGELOG.md
  2. +2 −8 lib/paper_trail/frameworks/rails.rb
  3. +2 −2 test/functional/thread_safety_test.rb
View
1 CHANGELOG.md
@@ -30,6 +30,7 @@
- [#119](https://github.com/airblade/paper_trail/issues/119) - Support for [Sinatra](http://www.sinatrarb.com/); decoupled gem from `Rails`.
- Renamed the default serializers from `PaperTrail::Serializers::Yaml` and `PaperTrail::Serializers::Json` to the capitalized forms,
`PaperTrail::Serializers::YAML` and `PaperTrail::Serializers::JSON`.
+ - Removed deprecated `set_whodunnit` method from Rails Controller scope.
## 2.7.2
View
10 lib/paper_trail/frameworks/rails.rb
@@ -59,19 +59,13 @@ def set_paper_trail_enabled_for_controller
# Tells PaperTrail who is responsible for any changes that occur.
def set_paper_trail_whodunnit
- ::PaperTrail.whodunnit = user_for_paper_trail if paper_trail_enabled_for_controller
- end
-
- # DEPRECATED: please use `set_paper_trail_whodunnit` instead.
- def set_whodunnit
- logger.warn '[PaperTrail]: the `set_whodunnit` controller method has been deprecated. Please rename to `set_paper_trail_whodunnit`.'
- set_paper_trail_whodunnit
+ ::PaperTrail.whodunnit = user_for_paper_trail if ::PaperTrail.enabled_for_controller?
end
# Tells PaperTrail any information from the controller you want
# to store alongside any changes that occur.
def set_paper_trail_controller_info
- ::PaperTrail.controller_info = info_for_paper_trail if paper_trail_enabled_for_controller
+ ::PaperTrail.controller_info = info_for_paper_trail if ::PaperTrail.enabled_for_controller?
end
end
View
4 test/functional/thread_safety_test.rb
@@ -6,7 +6,7 @@ class ThreadSafetyTest < ActionController::TestCase
slow_thread = Thread.new do
controller = TestController.new
- controller.send :set_whodunnit
+ controller.send :set_paper_trail_whodunnit
begin
sleep 0.001
end while blocked
@@ -15,7 +15,7 @@ class ThreadSafetyTest < ActionController::TestCase
fast_thread = Thread.new do
controller = TestController.new
- controller.send :set_whodunnit
+ controller.send :set_paper_trail_whodunnit
who = PaperTrail.whodunnit
blocked = false
who

0 comments on commit 4f6c575

Please sign in to comment.