默认情况下,rails 3.2
设置active_record.mass_assignment_sanitizer = :strict
在 config/environments/development.rb 中。(参见 railcasts 剧集http://railscasts.com/episodes/318-upgrading-to-rails-3-2)。这里是:
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
这使得mass assignment
开发中容易出错并强制列出attr_accessible
. 默认情况下这样做的原因是什么rails 3.2
(还没有检查它是否也是rails 4)?