active_model_serializers/lib/active_model_serializers.rb
Mauro George 5fb7cceafb Remove ActiveModelSerializers.silence_warnings dead code
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
2015-12-23 19:25:48 -02:00

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'