title: Is there a way to bypass mass assignment protection?
body: <p>I have a Rails 3 app which JSON encodes objects in order to store them in a Redis key/value store.</p>
  
  <p>When I retrieve the objects, I'm trying to decode the JSON and instantiate them from the data like so:</p>
  
  <pre><code>def decode(json)
    self.new(ActiveSupport::JSON.decode(json)["#{self.name.downcase}"])
  end
  </code></pre>
  
  <p>The problem is that doing this involves mass assignment which is disallowed (for good reason I'm told!) for attributes I haven't given attr_writer ability to.</p>
  
  <p>Is there a way I can bypass the mass assignment protection just for this operation only?</p>