On my system, I already defined STI. Doginherits from Animal, the table animalshas a column typewith a value "Dog".
Now I want to SpecialDoginherit from the dog, just slightly changed the behavior in some particular case. The data is all the same. I need all the queries that run through SpecialDogto return values in a database with a type Dog.
My problem is that since I have a column type, rails adds WHERE "animals"."type" IN ('SpecialDog')to my query, so I cannot get the original records Dog. So I want to somehow override the value that rails uses when it accesses the database through SpecialDogto behave like that Dog.
Is there a way to override value rails for a type column?
source
share