私のモデルスキーマ:
投票
has_many :questions
has_many :responses :through => :questions
質問
belongs_to :poll
has_many :responses
応答
belongs_to :question
実行しようとしたとき、または@poll.responses.delete_all
このエラーが発生したときの問題:clear
destroy_all
ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'Poll#responses' because the source reflection class 'Response' is associated to 'Question' via :has_many.
更新:これが発生している理由はまだわかりませんが、回避策は次のとおりです。
@poll.responses.each(&:destroy)