mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rename user_provided_types
to something more meaningful
`attributes_to_define_after_schema_loads` better describes the difference between `attribute` and `define_attribute`, and doesn't conflate terms since we no longer differentiate between "user provided" and "schema provided" types.
This commit is contained in:
parent
0c42be42f3
commit
35d77130a2
1 changed files with 4 additions and 4 deletions
|
@ -5,8 +5,8 @@ module ActiveRecord
|
|||
Type = ActiveRecord::Type
|
||||
|
||||
included do
|
||||
class_attribute :user_provided_types, instance_accessor: false # :internal:
|
||||
self.user_provided_types = {}
|
||||
class_attribute :attributes_to_define_after_schema_loads, instance_accessor: false # :internal:
|
||||
self.attributes_to_define_after_schema_loads = {}
|
||||
end
|
||||
|
||||
module ClassMethods # :nodoc:
|
||||
|
@ -77,7 +77,7 @@ module ActiveRecord
|
|||
name = name.to_s
|
||||
reload_schema_from_cache
|
||||
|
||||
self.user_provided_types = user_provided_types.merge(name => [cast_type, options])
|
||||
self.attributes_to_define_after_schema_loads = attributes_to_define_after_schema_loads.merge(name => [cast_type, options])
|
||||
end
|
||||
|
||||
def define_attribute(
|
||||
|
@ -92,7 +92,7 @@ module ActiveRecord
|
|||
|
||||
def load_schema!
|
||||
super
|
||||
user_provided_types.each do |name, (type, options)|
|
||||
attributes_to_define_after_schema_loads.each do |name, (type, options)|
|
||||
define_attribute(name, type, **options)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue