when I am using mongoid with Rails , I associated my model with has_one relation and used dependent destroy like this
class MyModel
has_one :foo , :dependent => :destroy
end
class Foo
belongs_to :mymodel
end
my_model.foo = Foo.new
then the it results the following error
RuntimeError (can't modify frozen Hash):
but if I remove dependent destroy , then no error ... I am not sure why it is
Can anyone please help me ... thanks in advance