Belongs_to presence in Rails 5 not working

前端 未结 3 1279
無奈伤痛
無奈伤痛 2021-02-15 16:16

To my knowledge, the new default in Rails 5 requires belongs_to associations to be present. I made a model with this association, but the problem is I don\'t get pr

3条回答
  •  一向
    一向 (楼主)
    2021-02-15 16:39

    I faced with same problem.

    You can move

    config.active_record.belongs_to_required_by_default = false

    to config/environments/needed_environment.rb or to config/application.rb

    Helped for me!

提交回复
热议问题