diff options
Diffstat (limited to 'activemodel/lib/active_model.rb')
-rw-r--r-- | activemodel/lib/active_model.rb | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/activemodel/lib/active_model.rb b/activemodel/lib/active_model.rb index 4e1b3f7495..bc10d6b4b9 100644 --- a/activemodel/lib/active_model.rb +++ b/activemodel/lib/active_model.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + #-- -# Copyright (c) 2004-2015 David Heinemeier Hansson +# Copyright (c) 2004-2018 David Heinemeier Hansson # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,36 +23,39 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -require 'active_support' -require 'active_support/rails' -require 'active_model/version' +require "active_support" +require "active_support/rails" +require "active_model/version" module ActiveModel extend ActiveSupport::Autoload + autoload :Attribute + autoload :Attributes autoload :AttributeAssignment autoload :AttributeMethods - autoload :BlockValidator, 'active_model/validator' + autoload :BlockValidator, "active_model/validator" autoload :Callbacks autoload :Conversion autoload :Dirty - autoload :EachValidator, 'active_model/validator' + autoload :EachValidator, "active_model/validator" autoload :ForbiddenAttributesProtection autoload :Lint autoload :Model - autoload :Name, 'active_model/naming' + autoload :Name, "active_model/naming" autoload :Naming autoload :SecurePassword autoload :Serialization - autoload :TestCase autoload :Translation + autoload :Type autoload :Validations autoload :Validator eager_autoload do autoload :Errors - autoload :StrictValidationFailed, 'active_model/errors' - autoload :UnknownAttributeError, 'active_model/errors' + autoload :RangeError, "active_model/errors" + autoload :StrictValidationFailed, "active_model/errors" + autoload :UnknownAttributeError, "active_model/errors" end module Serializers @@ -68,5 +73,5 @@ module ActiveModel end ActiveSupport.on_load(:i18n) do - I18n.load_path << File.dirname(__FILE__) + '/active_model/locale/en.yml' + I18n.load_path << File.expand_path("active_model/locale/en.yml", __dir__) end |