aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/model_schema.rb
diff options
context:
space:
mode:
authorLisa Ugray <lisa.ugray@shopify.com>2017-10-19 12:45:07 -0400
committerLisa Ugray <lisa.ugray@shopify.com>2017-11-09 14:29:39 -0500
commitc3675f50d2e59b7fc173d7b332860c4b1a24a726 (patch)
tree736119c8ea9b683ac465c07e6a640d7e14bbc1b0 /activerecord/lib/active_record/model_schema.rb
parentdac7c8844b4d9944eaa0fca98b45ee478cdb7201 (diff)
downloadrails-c3675f50d2e59b7fc173d7b332860c4b1a24a726.tar.gz
rails-c3675f50d2e59b7fc173d7b332860c4b1a24a726.tar.bz2
rails-c3675f50d2e59b7fc173d7b332860c4b1a24a726.zip
Move Attribute and AttributeSet to ActiveModel
Use these to back the attributes API. Stop automatically including ActiveModel::Dirty in ActiveModel::Attributes, and make it optional.
Diffstat (limited to 'activerecord/lib/active_record/model_schema.rb')
-rw-r--r--activerecord/lib/active_record/model_schema.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb
index bed9400f51..12ee4a4137 100644
--- a/activerecord/lib/active_record/model_schema.rb
+++ b/activerecord/lib/active_record/model_schema.rb
@@ -323,7 +323,7 @@ module ActiveRecord
end
def attributes_builder # :nodoc:
- @attributes_builder ||= AttributeSet::Builder.new(attribute_types, primary_key) do |name|
+ @attributes_builder ||= ActiveModel::AttributeSet::Builder.new(attribute_types, primary_key) do |name|
unless columns_hash.key?(name)
_default_attributes[name].dup
end
@@ -346,7 +346,7 @@ module ActiveRecord
end
def yaml_encoder # :nodoc:
- @yaml_encoder ||= AttributeSet::YAMLEncoder.new(attribute_types)
+ @yaml_encoder ||= ActiveModel::AttributeSet::YAMLEncoder.new(attribute_types)
end
# Returns the type of the attribute with the given name, after applying
@@ -376,7 +376,7 @@ module ActiveRecord
end
def _default_attributes # :nodoc:
- @default_attributes ||= AttributeSet.new({})
+ @default_attributes ||= ActiveModel::AttributeSet.new({})
end
# Returns an array of column names as strings.