I had a similar thought and went with `serialized?` for a few reasons. One
of them is just my aversion to is_a checks. We also have a lot of places
that are checking the serialized_attributes hash for the key, when they
could just ask the column. Finally, it felt like it fit nicely with text?,
binary?, and friends, and will encourage good practices if new forms of
serialization crop up later.
On May 29, 2014 12:16 PM, "Yves Senn" <notifications@github.com> wrote:

> In activerecord/lib/active_record/attribute_methods/serialization.rb:
>
> > @@ -58,32 +58,18 @@ def serialize(attr_name, class_name_or_coder = Object)
> >                      Coders::YAMLColumn.new(class_name_or_coder)
> >                    end
> >
> > +          type = columns_hash[attr_name.to_s].cast_type
> > +          if type.serialized?
>
> question is wether we need to introduce that serialized? method or if a
> is_a? check would be good enough. I'm asking because even if you have
> your custom serialization type, which responds to both serialized? and
> subtype, this method will always create a Type::Serialized.
>
> I don't think this use-case justifies broadening the Type interface.
> Thoughts?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/rails/rails/pull/15398/files#r13199141>
> .
>