mhuggins / multiple_table_inheritance

Multiple Table Inheritance is a plugin designed to allow for multiple table inheritance between your database tables and your ActiveRecord models.
30 stars 4 forks source link

Problem loading object when Rails identity map is active #16

Open dlebrun opened 11 years ago

dlebrun commented 11 years ago

I have two AR models: Offer and TranslationOffer, the latter "inheriting" from the former. The first time I fetch an Offer, the correct object is returned:

> Offer.find 1
=> #<TranslationOffer offer_id: 1>

But in case Rails' identity map is active, if I run the same line again, I get the parent object instead:

> Offer.find 1
=> #<Offer id: 1>

Of course a simple workaround is to disable the identity map, but there should be a less definitive way to deal with it. Isn't it possible to disable automatically the identity map for active record models that act as superclass?