mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Eager load modules on boot
Using ActiveModelSerializers with a threaded web server eg. Puma uninitialized constant errors are thrown. Leaving this article for reference: http://blog.plataformatec.com.br/2012/08/eager-loading-for-greater-good/.
This commit is contained in:
@@ -18,16 +18,18 @@ module ActiveModel
|
||||
# @see #serializable_hash for more details on these valid keys.
|
||||
SERIALIZABLE_HASH_VALID_KEYS = [:only, :except, :methods, :include, :root].freeze
|
||||
extend ActiveSupport::Autoload
|
||||
autoload :Adapter
|
||||
autoload :Null
|
||||
autoload :Attribute
|
||||
autoload :Association
|
||||
autoload :Reflection
|
||||
autoload :SingularReflection
|
||||
autoload :CollectionReflection
|
||||
autoload :BelongsToReflection
|
||||
autoload :HasOneReflection
|
||||
autoload :HasManyReflection
|
||||
eager_autoload do
|
||||
autoload :Adapter
|
||||
autoload :Null
|
||||
autoload :Attribute
|
||||
autoload :Association
|
||||
autoload :Reflection
|
||||
autoload :SingularReflection
|
||||
autoload :CollectionReflection
|
||||
autoload :BelongsToReflection
|
||||
autoload :HasOneReflection
|
||||
autoload :HasManyReflection
|
||||
end
|
||||
include ActiveSupport::Configurable
|
||||
include Caching
|
||||
|
||||
|
||||
Reference in New Issue
Block a user