Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 5f4850681ac5a964084a8cbcf3d1610d29f655e5 1 parent f5a61b4
@MarceloCajueiro MarceloCajueiro authored
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"
Please sign in to comment.
Something went wrong with that request. Please try again.