lib/draftsman/frameworks/rails.rb in draftsman-0.3.5 vs lib/draftsman/frameworks/rails.rb in draftsman-0.3.6
- old
+ new
@@ -1,13 +1,11 @@
module Draftsman
module Rails
module Controller
def self.included(base)
- if defined?(ActionController) && base == ActionController::Base
- base.before_filter :set_draftsman_whodunnit, :set_draftsman_controller_info
- end
+ base.before_filter :set_draftsman_whodunnit, :set_draftsman_controller_info
end
protected
# Returns the user who is responsible for any changes that occur.
@@ -52,7 +50,11 @@
def set_draftsman_controller_info
::Draftsman.controller_info = info_for_draftsman
end
end
+ end
+
+ if defined?(::ActionController)
+ ::ActiveSupport.on_load(:action_controller) { include Draftsman::Rails::Controller }
end
end