You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code checks for instance[options] in order to return instances[options]. Well, instance should be probably be plural there. The funny thing is that instance is also defined on the attachment, from the paperclip gem: it's the instance on which the attachment lives, so instead of seeing an error like "No such method: instance", this shows up as an error that the instance doesn't support the [] method.
I'm surprised that this code is working for anyone given that it impacts saving models with attachments. This leads me to question the conclusion I've drawn, but at the same time the code looks pretty clearly like it intends to use the plural there.
The text was updated successfully, but these errors were encountered:
Hi!
I'm getting the following error:
"NoMethodError: undefined method []' for #ModelWithAttachment:0x000055d59c8c0cb8"
With stack trace:
(I have replaced my model name with "ModelWithAttachment")
I believe it is due to what appears to be a typo here:
The code checks for
instance[options]
in order to returninstances[options]
. Well,instance
should be probably be plural there. The funny thing is thatinstance
is also defined on the attachment, from the paperclip gem: it's the instance on which the attachment lives, so instead of seeing an error like "No such method: instance", this shows up as an error that the instance doesn't support the[]
method.I'm surprised that this code is working for anyone given that it impacts saving models with attachments. This leads me to question the conclusion I've drawn, but at the same time the code looks pretty clearly like it intends to use the plural there.
The text was updated successfully, but these errors were encountered: