On Sep 28, 9:34 am, John Barnette <[email protected]> wrote:

> Fixture entries are intentionally tied to the structure of the DB.  
> Since that's the case, the association goes on the side with the  
> foreign key. In your situation, the users table has an account_id  
> field, and the accounts table has nothing.

Actually the accounts table has an administrator_id (which maps to id
in users) and the users table has an account_id column (which maps to
id in accounts).


> # users.yml
>
> default:
>    account: default
>
> ...will work fine with no annotation on the account side.

I'll try this. Thanks.


> On a more general note, I don't think your keys are in the right place. I'd 
> have  
> an administrator_id on accounts with a belongs_to pointing at users.

Thanks. I may try this. But it feels/reads a little less natural than
the way I currently have it expressed.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to