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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Preethi S. (Guest)
on 2009-02-28 08:20
I'm using has_many and through relationship between two models
Profile and User
has_and_belongs_to_many :users
belongs_to :community

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
This topic is locked and can not be replied to.