Rails converts empty arrays into nils in params of the request

后端 未结 6 1780
闹比i
闹比i 2021-02-01 12:20

I have a Backbone model in my app which is not a typical flat object, it\'s a large nested object and we store the nested parts in TEXT columns in a MySQL database.

I wa

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-01 12:53

    After much searching, I discovered that you starting in Rails 4.1 you can skip the deep_munge "feature" completely using

    config.action_dispatch.perform_deep_munge = false
    

    I could not find any documentation, but you can view the introduction of this option here: https://github.com/rails/rails/commit/e8572cf2f94872d81e7145da31d55c6e1b074247

    There is a possible security risk in doing so, documented here: https://groups.google.com/forum/#!topic/rubyonrails-security/t1WFuuQyavI

提交回复
热议问题