Skip to content
Browse files

Add refactoring in the controller generator

Call `respond_to?(:before_action)` to `ActionController::Base` instead of
call it to `ApplicationController` avoiding ask to ApplicationController
if it is defined.

Kudos to @lucasmazza
  • Loading branch information...
1 parent f5a61b4 commit 5f4850681ac5a964084a8cbcf3d1610d29f655e5 @MarceloCajueiro MarceloCajueiro committed Jul 10, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/generators/rails/responders_controller_generator.rb
View
2 lib/generators/rails/responders_controller_generator.rb
@@ -24,7 +24,7 @@ def orm_instance_update(params)
end
def controller_before_filter
- if defined?(ApplicationController) && ApplicationController.respond_to?(:before_action)
+ if ActionController::Base.respond_to?(:before_action)
"before_action"
else
"before_filter"

0 comments on commit 5f48506

Please sign in to comment.
Something went wrong with that request. Please try again.