ActiveModel::MissingAttributeError occurs after deploying and then goes away after a while

前端 未结 7 1004
我寻月下人不归
我寻月下人不归 2020-12-25 09:58

I have a Rails 3.0.9 app that, once it is deployed, suffers from a bunch of ActiveModel::MissingAttributeErrors that crop up causing 500s. The errors occur fairly randomly,

相关标签:
7条回答
  • 2020-12-25 10:40

    I encountered this issue. Make sure your select: includes all fields referenced in your view, including any relationship IDs and any attributes called within your methods.

    The missing attribute can be difficult to identify whenever your views and relationships are complex. The easiest way to debug this is to remove the select portion of your where clause and see if the query/scope/method runs correctly. If so, then add all of the attributes to the select and remove unneeded attributes one-at-a-time until you find the offending attribute.

    0 讨论(0)
提交回复
热议问题