mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
The ActiveModelSerializers.silence_warnings was used to avoid warnings on the Ruby interpreter when define a private attr_acessor. This method is not used in any part of the code and the recommend way to handle this case is to use protected instead the silence_warnings [1]. This patch remove the method from the project, this way we avoid people using this by mistake. [1]: https://bugs.ruby-lang.org/issues/10967
32 lines
880 B
Ruby
32 lines
880 B
Ruby
require 'active_model'
|
|
require 'active_support'
|
|
require 'action_controller'
|
|
require 'action_controller/railtie'
|
|
module ActiveModelSerializers
|
|
mattr_accessor(:logger) { ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT)) }
|
|
|
|
def self.config
|
|
ActiveModel::Serializer.config
|
|
end
|
|
|
|
extend ActiveSupport::Autoload
|
|
autoload :Model
|
|
autoload :Callbacks
|
|
autoload :Logging
|
|
end
|
|
|
|
require 'active_model/serializer'
|
|
require 'active_model/serializable_resource'
|
|
require 'active_model/serializer/version'
|
|
|
|
require 'action_controller/serialization'
|
|
ActiveSupport.on_load(:action_controller) do
|
|
ActiveSupport.run_load_hooks(:active_model_serializers, ActiveModelSerializers)
|
|
include ::ActionController::Serialization
|
|
ActionDispatch::Reloader.to_prepare do
|
|
ActiveModel::Serializer.serializers_cache.clear
|
|
end
|
|
end
|
|
|
|
require 'active_model/serializer/railtie'
|