aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-02 11:02:50 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-02 11:08:01 -0700
commit35d77130a2c08f477ce5e7f2e5b28934ad393641 (patch)
treee9ebb80113d0a1fdbfffb9f54b4d18d9a60ad976 /activerecord/lib
parent0c42be42f37037ca2711da5ae06cf15799a4c437 (diff)
downloadrails-35d77130a2c08f477ce5e7f2e5b28934ad393641.tar.gz
rails-35d77130a2c08f477ce5e7f2e5b28934ad393641.tar.bz2
rails-35d77130a2c08f477ce5e7f2e5b28934ad393641.zip
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.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/attributes.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/attributes.rb b/activerecord/lib/active_record/attributes.rb
index c1b69092bb..7cb6b075a0 100644
--- a/activerecord/lib/active_record/attributes.rb
+++ b/activerecord/lib/active_record/attributes.rb
@@ -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