Merge pull request #15741 from sgrif/sg-update-deprecation-message
Change the deprecation warning on `serialized_attributes`
This commit is contained in:
commit
3268a04e99
@ -50,14 +50,8 @@ def serialize(attr_name, class_name_or_coder = Object)
|
|||||||
|
|
||||||
def serialized_attributes
|
def serialized_attributes
|
||||||
ActiveSupport::Deprecation.warn(<<-WARNING.strip_heredoc)
|
ActiveSupport::Deprecation.warn(<<-WARNING.strip_heredoc)
|
||||||
`serialized_attributes` is deprecated, and will be removed in Rails 5.0.
|
`serialized_attributes` is deprecated without replacement, and will
|
||||||
If you need to access the serialization behavior, you can do:
|
be removed in Rails 5.0.
|
||||||
|
|
||||||
#{self.class.name}.column_for_attribute('foo').type_cast_for_database(value)
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
#{self.class.name}.column_for_attribute('foo').type_cast_from_database(value)
|
|
||||||
WARNING
|
WARNING
|
||||||
@serialized_attributes ||= Hash[
|
@serialized_attributes ||= Hash[
|
||||||
columns.select { |t| t.cast_type.is_a?(Type::Serialized) }.map { |c|
|
columns.select { |t| t.cast_type.is_a?(Type::Serialized) }.map { |c|
|
||||||
|
Loading…
Reference in New Issue
Block a user