Forum: Rails I18n has_many :through, expects "through" model to be belongs_to

Posted by Preethi Sivakumar (preethi)
on 2009-02-28 07:20
Hi,
I'm using has_many and through relationship between two models
Profile and User
Profile.rb
-----------
has_and_belongs_to_many :users
belongs_to :community

User.rb
-------
has_and_belongs_to_many :profiles
has_many :communities, :through=>profiles

When i try to do
@user.communities, Rails is searching for foreign key of user in profile
table, whereas profile and user have habtm relationship.
How to solve this problem?
Its urgent. please help
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.