Topic: Whats DRY way of assosiating Account model to all other models?
Hi, to elaborate, I have an Account model, and then the usual kind of stuff like User, Product etc. All Users and all Products belong to an Account. I could add belongs_to to each model and a account_id field to the table, but I will end up with around 20 models which need to be 'bound' to an Account... Is there a more DRY way to do this?
1.) Extend ActiveRecord - problem: not all models are assosiated to an Account, only most of them!
2.) Create a base class which is decended from AR and has the belongs_to, what would I call this class?
3.) Is there an acts_as ? Not found one yet...