Remove deprecated :set_whodunnit method from Rails::Controller module

This commit is contained in:
Ben Atkins 2013-12-02 11:18:43 -05:00
parent 498e03923c
commit 4f6c57550b
3 changed files with 5 additions and 10 deletions

View File

@ -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 File

@ -59,19 +59,13 @@ module PaperTrail
# 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 File

@ -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