# Insecure: can't modify hash

**URL:** <https://www.ruby-forum.com/t/insecure-cant-modify-hash/155710>\
**Category:** Rails\
**Created:** [December 15, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/insecure-cant-modify-hash/155710 "2008-12-15T20:31:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gremio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@gremio](https://www.ruby-forum.com/u/gremio)\
**Post date:** [December 15, 2008, 8:31pm UTC](https://www.ruby-forum.com/t/insecure-cant-modify-hash/155710/1 "2008-12-15T20:31:28Z")

</div>

A weird problem occurs (only on the prod server, not locally), when i  
try to register a new user with restful\_authentication.

Once in a while, i get the following error when trying to sign up as a  
new user:

Insecure: can’t modify hash

usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/attribute\_methods.rb:309:in  
`delete' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:309:in`write\_attribute\_without\_dirty’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/dirty.rb:139:in  
`write_attribute' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:211:in`deleted\_at=’  
app/models/user.rb:113:in `make_activation_code' app/controllers/users_controller.rb:30:in`create’  
/usr/bin/mongrel\_rails:16:in `load’  
/usr/bin/mongrel\_rails:16

Im really clueless on what’s causing it. Even more strange is that it  
doesn’t right after a fresh deploy, and it doesn’t happen locally. My  
first reaction was to run rake db:sessions:clear in case there was some  
unwanted persistence in the sessions, but it doesn’t seem to come from  
that…

If any knows about that error and could help… thanks :!
