2009-03-19 19:28:59 -04:00
|
|
|
#--
|
2015-12-31 11:27:19 -05:00
|
|
|
# Copyright (c) 2004-2016 David Heinemeier Hansson
|
2009-03-19 19:28:59 -04:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be
|
|
|
|
# included in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
#++
|
|
|
|
|
2009-05-29 17:06:21 -04:00
|
|
|
require 'active_support'
|
2012-08-02 12:07:20 -04:00
|
|
|
require 'active_support/rails'
|
2010-10-10 19:11:04 -04:00
|
|
|
require 'active_model/version'
|
2009-12-16 12:56:51 -05:00
|
|
|
|
2009-03-19 19:28:59 -04:00
|
|
|
module ActiveModel
|
2009-12-02 23:01:01 -05:00
|
|
|
extend ActiveSupport::Autoload
|
|
|
|
|
2015-01-23 06:57:34 -05:00
|
|
|
autoload :AttributeAssignment
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :AttributeMethods
|
2010-01-04 17:29:07 -05:00
|
|
|
autoload :BlockValidator, 'active_model/validator'
|
2009-12-28 19:15:39 -05:00
|
|
|
autoload :Callbacks
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :Conversion
|
|
|
|
autoload :Dirty
|
2010-01-04 17:29:07 -05:00
|
|
|
autoload :EachValidator, 'active_model/validator'
|
2012-07-13 04:51:13 -04:00
|
|
|
autoload :ForbiddenAttributesProtection
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :Lint
|
2012-03-02 23:20:17 -05:00
|
|
|
autoload :Model
|
2009-12-22 18:36:51 -05:00
|
|
|
autoload :Name, 'active_model/naming'
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :Naming
|
2010-12-18 16:38:05 -05:00
|
|
|
autoload :SecurePassword
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :Serialization
|
2010-01-04 17:29:07 -05:00
|
|
|
autoload :TestCase
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :Translation
|
|
|
|
autoload :Validations
|
|
|
|
autoload :Validator
|
2009-06-17 22:27:36 -04:00
|
|
|
|
2012-08-01 14:54:22 -04:00
|
|
|
eager_autoload do
|
|
|
|
autoload :Errors
|
2016-05-03 14:37:11 -04:00
|
|
|
autoload :RangeError, 'active_model/errors'
|
2014-04-16 17:48:51 -04:00
|
|
|
autoload :StrictValidationFailed, 'active_model/errors'
|
2015-02-25 09:14:43 -05:00
|
|
|
autoload :UnknownAttributeError, 'active_model/errors'
|
2012-08-01 14:54:22 -04:00
|
|
|
end
|
|
|
|
|
2009-06-17 22:27:36 -04:00
|
|
|
module Serializers
|
2009-12-02 23:01:01 -05:00
|
|
|
extend ActiveSupport::Autoload
|
|
|
|
|
2012-08-01 14:54:22 -04:00
|
|
|
eager_autoload do
|
|
|
|
autoload :JSON
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-01-17 12:24:48 -05:00
|
|
|
def self.eager_load!
|
2012-08-01 14:54:22 -04:00
|
|
|
super
|
2014-01-17 12:24:48 -05:00
|
|
|
ActiveModel::Serializers.eager_load!
|
2009-06-17 22:27:36 -04:00
|
|
|
end
|
2009-03-19 19:28:59 -04:00
|
|
|
end
|
2009-03-20 17:40:37 -04:00
|
|
|
|
2012-05-10 19:48:23 -04:00
|
|
|
ActiveSupport.on_load(:i18n) do
|
|
|
|
I18n.load_path << File.dirname(__FILE__) + '/active_model/locale/en.yml'
|
|
|
|
end
|