Remove defunct controller ivar

This commit is contained in:
Jared Beck 2017-12-07 14:08:12 -05:00
parent 468c5cea48
commit 364e64a181
2 changed files with 8 additions and 4 deletions

View File

@ -13,7 +13,8 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
belongs_to_required_by_default will produce an error instead of a warning.
- Failing to set PaperTrail.config.track_associations will no longer produce
a warning. The default (false) will remain the same.
- warn_about_not_setting_whodunnit controller method
- The `warn_about_not_setting_whodunnit` controller method will be removed.
Remove callbacks like `skip_after_action :warn_about_not_setting_whodunnit`.
- [#997](https://github.com/airblade/paper_trail/pull/997) -
where_object_changes reading YAML from a text column

View File

@ -66,14 +66,17 @@ module PaperTrail
# Tells PaperTrail who is responsible for any changes that occur.
def set_paper_trail_whodunnit
@set_paper_trail_whodunnit_called = true
::PaperTrail.whodunnit = user_for_paper_trail if ::PaperTrail.enabled_for_controller?
if ::PaperTrail.enabled_for_controller?
::PaperTrail.whodunnit = user_for_paper_trail
end
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 ::PaperTrail.enabled_for_controller?
if ::PaperTrail.enabled_for_controller?
::PaperTrail.controller_info = info_for_paper_trail
end
end
# We have removed this warning. We no longer add it as a callback.