mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Revert "clean up lazy loading of serialization support for
ActiveRecord::Base and ActionController::Base"
The whole idea of having a lazy hook is that it can be executed
in the context of different targets. The moment you hardcode the class,
the hooks can no longer run in the proper context.
This reverts commit 506e2ac9ad.
This commit is contained in:
@@ -57,7 +57,7 @@ module ActiveModel::SerializerSupport
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
ActiveRecord::Base.send(:include, ActiveModel::SerializerSupport)
|
||||
include ActiveModel::SerializerSupport
|
||||
end
|
||||
|
||||
module ActiveModel::ArraySerializerSupport
|
||||
@@ -78,7 +78,7 @@ begin
|
||||
require 'action_controller/serialization'
|
||||
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
ActionController::Base.send(:include, ActionController::Serialization)
|
||||
include ::ActionController::Serialization
|
||||
end
|
||||
rescue LoadError => ex
|
||||
# rails on installed, continuing
|
||||
|
||||
Reference in New Issue
Block a user