On 26 Sep 2008, at 17:28, Mark Wilden wrote:

I think all of your comments make sense, but I did just want to call out that "the Rails way" is not typically concerned with this sort of integrity at the database level. It's handled in the model.

Ah ok, I wasn't sure if your comment was intended to be neutral. You're right, the Rails way is not concerned with DB-level integrity.

Whether that's a good or bad thing can be debated, but it does explain why STI's drawbacks don't outweigh its strengths (primarily speed, compared to CTI, because of the lack of joins) in the minds of true Rails believers.

I've avoided STI unless the models share all the attributes (and therefore you . But it can be used acceptably at a Ruby level (be sure to spec what attributes your classes have if you're scared of pollution!) - it just means more hassle if you work in the DB directly.

Ashley

--
http://www.patchspace.co.uk/
http://aviewfromafar.net/



_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to