以下ActiveRecord查询导致错误“无法绑定多部分标识符question_answer_response.response_group。”
这从Rails 3.2.x升级到Rails 4.0.x后才开始发生
class Question < ActiveRecord::Base
def self.fetch_dependencies(section_id)
self.select('questions.*,question_answer_response.response as response,question_answer_response.response_group as response_group').
includes({:dependency_conditions => :dependency}).
where("dependencies.survey_section_id = #{section_id} and questions.survey_section_id != dependencies.survey_section_id")
end
end