mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove deprecated serialized_attributes
This commit is contained in:
parent
eef8a2c6f2
commit
82043ab53c
3 changed files with 4 additions and 19 deletions
|
@ -1,3 +1,7 @@
|
|||
* Remove deprecated `serialized_attributes`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated automatic counter caches on `has_many :through`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
|
|
@ -51,19 +51,6 @@ module ActiveRecord
|
|||
Type::Serialized.new(type, coder)
|
||||
end
|
||||
end
|
||||
|
||||
def serialized_attributes
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
`serialized_attributes` is deprecated without replacement, and will
|
||||
be removed in Rails 5.0.
|
||||
MSG
|
||||
|
||||
@serialized_attributes ||= Hash[
|
||||
columns.select { |t| t.cast_type.is_a?(Type::Serialized) }.map { |c|
|
||||
[c.name, c.cast_type.coder]
|
||||
}
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,12 +22,6 @@ class SerializedAttributeTest < ActiveRecord::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_list_of_serialized_attributes
|
||||
assert_deprecated do
|
||||
assert_equal %w(content), Topic.serialized_attributes.keys
|
||||
end
|
||||
end
|
||||
|
||||
def test_serialized_attribute
|
||||
Topic.serialize("content", MyObject)
|
||||
|
||||
|
|
Loading…
Reference in a new issue