我得到“堆栈级别太深”在 Rails 3 和 mongoid 环境中保存/创建实例时出错?

发布于 2024-12-12 21:44:56 字数 529 浏览 1 评论 0原文

在 Rails 3 和 mongoid 环境中保存/创建实例时出现“堆栈级别太深”错误?

没有错误:

@nameq = Question.new(:survey_id => @survey.id, :title => 'Example Question', :required_question => true, :input => 'string', :uuid => Time.now.to_i, :position => 1)

错误“堆栈级别太深”

@nameq = Question.create(:survey_id => @survey.id, :title => 'Example Question', :required_question => true, :input => 'string', :uuid => Time.now.to_i, :position => 1)

这种情况的常见原因是什么?

I got "stack level too deep" error when saving / creating an instance in Rails 3 and mongoid environment?

No errors:

@nameq = Question.new(:survey_id => @survey.id, :title => 'Example Question', :required_question => true, :input => 'string', :uuid => Time.now.to_i, :position => 1)

Errors "stack level too deep"

@nameq = Question.create(:survey_id => @survey.id, :title => 'Example Question', :required_question => true, :input => 'string', :uuid => Time.now.to_i, :position => 1)

What's common reasons in this situation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剪不断理还乱 2024-12-19 21:44:56

1)捕获该错误:

开始

救援系统堆栈错误
把$!
放置调用者[0..100]
结束

2) :自动保存 =>两个模型中的 true 可能是负责的

1) catch that error:

begin
foo
rescue SystemStackError
puts $!
puts caller[0..100]
end

2) :autosave => true in two models could be responsible

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文