From d3bdc9be576b7b2e07827359d2db54070f025ef4 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 15 Jan 2016 01:51:28 -0600 Subject: [PATCH] Replace load hook :active_model_serializers with :action_controller --- docs/general/configuration_options.md | 2 +- .../railtie_test_isolated.rb | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/general/configuration_options.md b/docs/general/configuration_options.md index 61cdb58a..f6ca8635 100644 --- a/docs/general/configuration_options.md +++ b/docs/general/configuration_options.md @@ -24,4 +24,4 @@ preferably inside an initializer. ## Hooks -To run a hook when ActiveModelSerializers is loaded, use `ActiveSupport.on_load(:active_model_serializers) do end` +To run a hook when ActiveModelSerializers is loaded, use `ActiveSupport.on_load(:action_controller) do end` diff --git a/test/active_model_serializers/railtie_test_isolated.rb b/test/active_model_serializers/railtie_test_isolated.rb index 60d8f900..2e2818ed 100644 --- a/test/active_model_serializers/railtie_test_isolated.rb +++ b/test/active_model_serializers/railtie_test_isolated.rb @@ -28,12 +28,6 @@ class RailtieTest < ActiveSupport::TestCase assert_equal ActionController::Base.cache_store, ActiveModelSerializers.config.cache_store assert_equal Rails.configuration.action_controller.perform_caching, ActiveModelSerializers.config.perform_caching end - - test 'it runs the load hook' do - loaded = false - ActiveSupport.on_load(:active_model_serializers) { loaded = true } - assert loaded - end end class WithoutRails < RailtieTest @@ -59,11 +53,5 @@ class RailtieTest < ActiveSupport::TestCase refute Rails.configuration.action_controller.perform_caching refute ActiveModelSerializers.config.perform_caching end - - test "it hasn't run the load hook" do - loaded = false - ActiveSupport.on_load(:active_model_serializers) { loaded = true } - refute loaded - end end end