This project is archived and is in readonly mode.

#204 ✓stale

serialized :attribute fails when specified in STI subclass

Reported by Wes | May 15th, 2008 @ 10:00 PM

When using STI, if a subclass specifies that an attribute is to be serialized, and that attribute was not specified as serialized in the base class, serialization of the attribute fails.

This bug will only occur in production, not in development mode due to the class reloading in development mode.

class Droid < ActiveRecord::Base


class R2D2 < Droid

serialize :secret_message


If the R2D2 class is loaded in production after the Droid class is loaded, then the serialization of the secret_message attribute will fail.

Patch and tests attached.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by