From 2801786e1a51b7cf7d7c3fd72b5fc9974f83f435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 1 Aug 2012 20:54:22 +0200 Subject: Get rid of config.preload_frameworks in favor of config.eager_load_namespaces The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly. --- activemodel/lib/active_model.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'activemodel/lib/active_model.rb') diff --git a/activemodel/lib/active_model.rb b/activemodel/lib/active_model.rb index ec2d734647..d1cc19ec6b 100644 --- a/activemodel/lib/active_model.rb +++ b/activemodel/lib/active_model.rb @@ -34,7 +34,6 @@ module ActiveModel autoload :Conversion autoload :Dirty autoload :EachValidator, 'active_model/validator' - autoload :Errors autoload :Lint autoload :MassAssignmentSecurity autoload :Model @@ -49,11 +48,22 @@ module ActiveModel autoload :Validations autoload :Validator + eager_autoload do + autoload :Errors + end + module Serializers extend ActiveSupport::Autoload - autoload :JSON - autoload :Xml + eager_autoload do + autoload :JSON + autoload :Xml + end + end + + def eager_load! + super + ActiveModel::Serializer.eager_load! end end -- cgit v1.2.3