我在 Rails 2 中工作。我有三个表users:lms_users和group_details。
在lms_usersid fromusers和group_details作为外键来。lms_users也有自己的属性。我无法在他们各自的模型中定义关联。我试过这个:
在LmsUser模型中
belongs_to :users
belongs_to :group_details
在User模型中
has_many :group_details , :through => :lms_users
在GroupDetail模型中
has_many :users , :through => :lms_users
但我收到了这个错误
ActiveRecord::ConfigurationError in Lms usersController#index
Association named 'lms_user' was not found; perhaps you misspelled it?