You need to add the association you are going with as has_many.
So, for example, your user.rb should look like this:
has_many :lms_users has_many :group_details , :through => :lms_users
And your group_detail.rb should contain the following:
has_many :lms_users has_many :users , :through => :lms_users
: through the union, so the association should already be configured.
source share