1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add missing autoload Type (#31123)

Attribute modules (`Attribute`, `Attributes`, `AttributeSet`) uses
`Type`, but referencing `Type` before the modules still fail.

```
% ./bin/test -w test/cases/attribute_test.rb -n test_with_value_from_user_validates_the_value
Run options: -n test_with_value_from_user_validates_the_value --seed 31876

E

Error:
ActiveModel::AttributeTest#test_with_value_from_user_validates_the_value:
NameError: uninitialized constant ActiveModel::AttributeTest::Type
    /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attribute_test.rb:233:in `block in <class:AttributeTest>'

bin/test test/cases/attribute_test.rb:232

Finished in 0.002985s, 335.0479 runs/s, 335.0479 assertions/s.
1 runs, 1 assertions, 0 failures, 1 errors, 0 skips
```

Probably we need more autoloading at least `Type`.
This commit is contained in:
Ryuta Kamizono 2017-11-11 06:43:54 +09:00 committed by GitHub
parent 4528dd6327
commit 24b59434e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 2 additions and 17 deletions

View file

@ -47,6 +47,7 @@ module ActiveModel
autoload :SecurePassword
autoload :Serialization
autoload :Translation
autoload :Type
autoload :Validations
autoload :Validator

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "active_support/core_ext/object/duplicable"
require "active_model/type"
module ActiveModel
class Attribute # :nodoc:

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "active_support/core_ext/object/deep_dup"
require "active_model/type"
require "active_model/attribute_set"
require "active_model/attribute/user_provided_default"

View file

@ -2,7 +2,6 @@
require "cases/helper"
require "active_model/attribute_set"
require "active_model/type"
module ActiveModel
class AttributeSetTest < ActiveModel::TestCase

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
require "active_support/core_ext/numeric/time"
module ActiveModel

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require "cases/helper"
require "active_model/type"
module ActiveModel
module Type

View file

@ -104,6 +104,7 @@ module ActiveRecord
autoload :Result
autoload :TableMetadata
autoload :Type
end
module Coders

View file

@ -1,6 +1,5 @@
# frozen_string_literal: true
require "active_record/type"
require "active_record/connection_adapters/determine_if_preparable_visitor"
require "active_record/connection_adapters/schema_cache"
require "active_record/connection_adapters/sql_type_metadata"