Cheat ActiveRecord with pg_morph!
pg_morph is a gem created by Hania Seweryn from Lunar Logic. It makes it possible to add foreign key constraints for each polymorphic relation type with ActiveRecord and postgreSQL. Hania wrote the “Polymorphic relations and DB consistency with ease? From now – yes!” post about it. Have a nice reading!
Comments
And here is a small (but not insignificant :) ) improvement of pg_morph gem
Post a comment