[rspec-users] Associations should be private

Ashley Moran ashley.moran at patchspace.co.uk
Wed Oct 1 08:54:24 EDT 2008


The discussion among me, David, Michael, and Pat got me thinking.   
Specifically this by Michael:

> Just my $0.02, but I really like specs to be treated as  
> specifications for what SHOULD be happening, not pretending other  
> code is different than it is.

This made me think the real solution is for ActiveRecord/A N Other ORM  
to declare that its associations are proxies and not arrays.  But  
that's *terrible*, because it's encouraging users to manipulate the  
ORM objects' structures.

So what if you flatly make all associations private?  Is this a good  
idea?  Has anyone tried it?



More information about the rspec-users mailing list