Newbie question regarding single table inheritance

In STI, how does one tell whether a subclass uses a certain attribute or
not?
Eric

I don’t think there is a way to tell in your models. All attributes
would be available to each of the subclasses. Its up to you to know
which attributes belongs to each model.

Peer

Eric L. wrote:

In STI, how does one tell whether a subclass uses a certain attribute or
not?
Eric

I’m not sure but on AWDWR (page 342) I found this

“When defining the table, remember that the attributes of subclasses
will be present only in the table rows corresponding to those
subclasses”

So , I agree that there isn’t a way to tell your models

“When defining the table, remember that the attributes of subclasses
will be present only in the table rows corresponding to those
subclasses”

Yes, but I think if I were to set attributes corresponding to a
sibling class, Rails would still let me, assuming I haven’t put in
place any validation that the field cannot be set.

So, it seems unless I validate that only the fields for a subclass can
be set, the only way to tell is to ask the original developer or
figure out based on intuition or reading the code.