Closed azul closed 6 years ago
The following code raises NoMethodError undefined method `each' for nil:NilClass
doc = Model.find(id) dup = Model.find(id) doc.destroy dup.reload
I understand that inside it performs a get ... which returns nil and then tries to enumerate nils attributes. But this is a very strange error to catch on a reload. A NotFound Error would make a lot more sense.
The following code raises NoMethodError undefined method `each' for nil:NilClass
I understand that inside it performs a get ... which returns nil and then tries to enumerate nils attributes. But this is a very strange error to catch on a reload. A NotFound Error would make a lot more sense.