can't modify frozen Hash in rails3
19,172
As explained in comments, you cannot update attributes on destroyed objects.
Check with something like:
write_attribute(:value, new_value) unless destroyed?
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on August 02, 2022Comments
-
Admin almost 2 years
I'm getting the following error,
can't modify frozen Hash /home/.rvm/gems/ruby-1.9.3-p327@ui/gems/activerecord-3.2.6/lib/active_r ecord/attribute_methods/write.rb:38:in `[]=' /home/.rvm/gems/ruby-1.9.3-p327@ui/gems/activerecord-3.2.6/lib/active_r ecord/attribute_methods/write.rb:38:in `write_attribute'
from this line
write_attribute(:value, new_value)
This can be run properly for certain days. But, now it fail continously with an above error. I tried out solution for that but nothing work for me.
-
Admin over 11 yearsIts working fine for me. But, if the condition fails the above error must return. how i overcome this?\
-
apneadiving over 11 yearsI can't see any other reason why it could happen
-
D. Visser about 8 yearsOf course there is a Model.destroyed? method, I should have known.