This only recently started happening and I haven't changed much of
anywhere from before I started getting this error.
This happens when I'm updating a user account (I'm using
auth_generator). Weird thing is if I take the image upload form field
out of the view, it runs fine... But I kind of need that form field to
update user icons (Again this worked fine a little while ago and I've
tried to revert any changes I've made since with no luck, obviously I
missed something. I suppose I should write better tests :-\ ). I'm
just having trouble finding out where the actual problem is.
What are the most common causes of the: "TypeError (singleton can't be
dumped)" error? Thanks.
This only recently started happening and I haven't changed much of
anywhere from before I started getting this error.
This happens when I'm updating a user account (I'm using
auth_generator). Weird thing is if I take the image upload form field
out of the view, it runs fine... But I kind of need that form field to
update user icons (Again this worked fine a little while ago and I've
tried to revert any changes I've made since with no luck, obviously I
missed something. I suppose I should write better tests :-\ ). I'm
just having trouble finding out where the actual problem is.
What are the most common causes of the: "TypeError (singleton can't be
dumped)" error? Thanks.
The dumping in question is the serialisation of an object into the session. In Ruby terminology, a singleton is an instance that has methods added to it (i.e. methods in addition to those defined in its class).
As a general point, your application will be more robust if you hold the IDs of persistent objects in your session, rather than the objects themselves.
I hope that helps, because that's the whole extent of my knowledge!
"What are the most common causes of the: "TypeError (singleton can't be
dumped)" error? "
you put IO kind of objects or singleton obj into session, when rails
try to serialize it and save it into session, ruby complains since they
can't be marshalled/serialized.
uploaded image blob is of StringIO type, you should exclude that from
saving into session.