[Rails] Re: Stack overflow problem

Eric Anderson eric at afaik.us
Fri Jan 7 23:58:02 GMT 2005


Andreas Schwarz wrote:
> Eric Anderson wrote:
> 
>> I have the following models (these are the relevant pieces):
>>
>> class User < ActiveRecord::Base
>>     belongs_to :account, :foreign_key => 'account'
> 
> 
> Try :foreign_key => 'account_id'.

But the field on the user table is "account" not account_id (I created 
these tables before I started using rails on the database). Here is the 
relevant parts of the user definition:

CREATE TABLE user (
     id INT AUTO_INCREMENT PRIMARY KEY,
     account INT,
     username VARCHAR(50)
)

Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://one.textdrive.com/pipermail/rails/attachments/20050107/8e099f1f/signature.bin


More information about the Rails mailing list