2017-07-16 13:11:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2009-03-19 19:28:59 -04:00
|
|
|
#--
|
2020-12-31 22:21:20 -05:00
|
|
|
# Copyright (c) 2004-2021 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.
|
|
|
|
#++
|
|
|
|
|
2016-08-06 12:38:02 -04:00
|
|
|
require "active_support"
|
|
|
|
require "active_support/rails"
|
2017-10-21 09:15:16 -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
|
|
|
|
|
2017-10-19 12:45:07 -04:00
|
|
|
autoload :Attribute
|
|
|
|
autoload :Attributes
|
2015-01-23 06:57:34 -05:00
|
|
|
autoload :AttributeAssignment
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :AttributeMethods
|
2016-08-06 12:38:02 -04: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
|
2016-08-06 12:38:02 -04: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
|
2016-08-06 12:38:02 -04: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
|
|
|
|
autoload :Translation
|
2017-11-10 16:43:54 -05:00
|
|
|
autoload :Type
|
2009-12-02 23:01:01 -05:00
|
|
|
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
|
2019-07-09 08:40:57 -04:00
|
|
|
autoload :Error
|
2016-08-06 12:38:02 -04:00
|
|
|
autoload :RangeError, "active_model/errors"
|
|
|
|
autoload :StrictValidationFailed, "active_model/errors"
|
|
|
|
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
|
2017-05-15 10:17:28 -04:00
|
|
|
I18n.load_path << File.expand_path("active_model/locale/en.yml", __dir__)
|
2012-05-10 19:48:23 -04:00
|
|
|
end
|