Matt Proud
2007-Nov-07 19:28 UTC
Serialization of ActiveRecord Instances: No Inheritance Column?
Hey, I have been looking at ActiveRecord''s serialization code, and noticed that ActiveRecord::XmlSerializer#serializable_attributes purposely excludes the STI inheritance column per ``options[:except] Array(options[:except]) | Array(@record.class.inheritance_column).'''' Is there a particular reason for this? Would anyone be opposed to my writing a patch to have this attribute be included? Cheers, Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
DHH
2007-Nov-07 23:20 UTC
Re: Serialization of ActiveRecord Instances: No Inheritance Column?
> I have been looking at ActiveRecord''s serialization code, and noticed > that ActiveRecord::XmlSerializer#serializable_attributes purposely > excludes the STI inheritance column per ``options[:except] > Array(options[:except]) | Array(@record.class.inheritance_column).'''' > Is there a particular reason for this? Would anyone be opposed to my > writing a patch to have this attribute be included?The type is not part of the attributes. The type should be used as the encapsulating tag. So if you have type=SpecialProduct, you''ll get <special-product><attributes/>.. That''s by design. Why do you want it included? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Pleas
- Change the value stored in inheritance_column
- Disabling ActiveRecord "type" column subclassing
- Re: ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. P
- Re: STI and Joins Broken