开发者

validates_associated in production

Imagine a simple model.

class Service
  belongs_to :user
  validates_associated :user
  accepts_nested_attributes_for :user
end

Nothing special right? The validations on the associated User model trigger correctly in development mode. But don't do anything in production. I've added a validates_on_presence :user just like the docs say. This triggers when there's no User associated with the Service,开发者_如何学编程 but fill in one thing on the User model and nothing happens! It's driving me up the walls. Am I overlooking something?

More info about the MVC: I use formtastic for the forms.

Thanks!


It might be something simple like

  1. Did you restart your server after deploying?
  2. Do you need to run any migrations on the production db?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜