From 35fac87123df4fdf7cc26b7ccd724932d946be87 Mon Sep 17 00:00:00 2001 From: Julian Nadeau Date: Mon, 13 Mar 2017 17:37:22 -0400 Subject: [PATCH] Add action_controller_api, action_controller_base on_load hook --- actionpack/lib/action_controller/api.rb | 1 + actionpack/lib/action_controller/base.rb | 1 + activesupport/CHANGELOG.md | 14 +++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/api.rb b/actionpack/lib/action_controller/api.rb index 0d1af0d0bd..94698df730 100644 --- a/actionpack/lib/action_controller/api.rb +++ b/actionpack/lib/action_controller/api.rb @@ -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 diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index b420e00c78..8c2b111f89 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -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 diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 1adc473e1d..17677d057b 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -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. \ No newline at end of file