Skip to content

Commit d3bdc9b

Browse files
committed
Replace load hook :active_model_serializers with :action_controller
1 parent ea8d463 commit d3bdc9b

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

docs/general/configuration_options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ preferably inside an initializer.
2424

2525
## Hooks
2626

27-
To run a hook when ActiveModelSerializers is loaded, use `ActiveSupport.on_load(:active_model_serializers) do end`
27+
To run a hook when ActiveModelSerializers is loaded, use `ActiveSupport.on_load(:action_controller) do end`

test/active_model_serializers/railtie_test_isolated.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ class WithRails < RailtieTest
2828
assert_equal ActionController::Base.cache_store, ActiveModelSerializers.config.cache_store
2929
assert_equal Rails.configuration.action_controller.perform_caching, ActiveModelSerializers.config.perform_caching
3030
end
31-
32-
test 'it runs the load hook' do
33-
loaded = false
34-
ActiveSupport.on_load(:active_model_serializers) { loaded = true }
35-
assert loaded
36-
end
3731
end
3832

3933
class WithoutRails < RailtieTest
@@ -59,11 +53,5 @@ class WithoutRails < RailtieTest
5953
refute Rails.configuration.action_controller.perform_caching
6054
refute ActiveModelSerializers.config.perform_caching
6155
end
62-
63-
test "it hasn't run the load hook" do
64-
loaded = false
65-
ActiveSupport.on_load(:active_model_serializers) { loaded = true }
66-
refute loaded
67-
end
6856
end
6957
end

0 commit comments

Comments
 (0)