Condensing code in the 'included' method on the Controller module.

This commit is contained in:
Ben Atkins 2012-11-16 12:16:28 -05:00
parent 50f94af6b8
commit 2827d0aad4
1 changed files with 2 additions and 3 deletions

View File

@ -3,15 +3,14 @@ module PaperTrail
def self.included(base)
base.before_filter :set_paper_trail_enabled_for_controller
base.before_filter :set_paper_trail_whodunnit
base.before_filter :set_paper_trail_controller_info
base.before_filter :set_paper_trail_whodunnit, :set_paper_trail_controller_info
end
protected
# Returns the user who is responsible for any changes that occur.
# By default this calls `current_user` and returns the result.
#
#
# Override this method in your controller to call a different
# method, e.g. `current_person`, or anything you like.
def user_for_paper_trail