Andrew
Andrew

Reputation: 43153

Make mass_assignment protection error not silent in Rails 3.2.x?

This is a fairly simple thing, but since Rails 3.2 mass-assignment protection is enabled by default, is there a way to make rails raise an exception in dev or test when you try to set a protected attribute via mass assignment?

Upvotes: 0

Views: 69

Answers (1)

Luke W
Luke W

Reputation: 8934

in development.rb, the following is commented out by default. uncomment it.

config.active_record.mass_assignment_sanitizer = :strict

Upvotes: 1

Related Questions