Add action_controller_api, action_controller_base on_load hook

This commit is contained in:
Julian Nadeau 2017-03-13 17:37:22 -04:00
parent c134a17b3d
commit 35fac87123
No known key found for this signature in database
GPG Key ID: CAD41019602B5DC8
3 changed files with 15 additions and 1 deletions

@ -141,6 +141,7 @@ def self.without_modules(*modules)
include mod
end
ActiveSupport.run_load_hooks(:action_controller_api, self)
ActiveSupport.run_load_hooks(:action_controller, self)
end
end

@ -267,6 +267,7 @@ def self.make_response!(request)
end
end
ActiveSupport.run_load_hooks(:action_controller_base, self)
ActiveSupport.run_load_hooks(:action_controller, self)
end
end

@ -1,7 +1,19 @@
* Add `action_controller_api` and `action_controller_base` load hooks to be called in `ActiveSupport.on_load`
`ActionController::Base` and `ActionController::API` have differing implementations. This means that
the one umbrella hook `action_controller` is not able to address certain situations where a method
may not exist in a certain implementation.
This is fixed by adding two new hooks so you can target `ActionController::Base` vs `ActionController::API`
Fixes #27013.
*Julian Nadeau*
* Add `fetch_values` for `HashWithIndifferentAccess`
The method was originally added to `Hash` in Ruby 2.3.0.
*Josh Pencheon*
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/activesupport/CHANGELOG.md) for previous changes.
Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/activesupport/CHANGELOG.md) for previous changes.