LoginSignup
0
0

More than 1 year has passed since last update.

フォロー機能での SystemStackError

Posted at

フォロー機能
フォローを解除したときに解除できない
なんだ

開発環境

ruby 2.6.5
Ruby on Rails 5.2.5

現象は解除した瞬間に
どっとクエリが流れたあとに

Traceback (most recent call last):
        2: from (irb):3
        1: from (irb):3:in `rescue in irb_binding'
SystemStackError (stack level too deep)
irb(main):004:0> quit

というエラー。無限ループになるとこれがでるらしい


User モデルと その中間モデルである Relationship モデルの両方に

dependent: :destroy

をいれていた。

どうやら両方にいれるとこういうエラーになるらしい
なんとなくふわっと納得

Relationship 側の dependent: :destroy を削除して解決

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0