has many through with source code example
Example: has many through source
class User < ActiveRecord::Base
has_many :answered_questions, through: :answers, source: :question
end
class User < ActiveRecord::Base
has_many :answered_questions, through: :answers, source: :question
end