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
I've just been upgrading some projects that use Carrierwave, and have stumbled upon a change in behaviour that is causing me some problems, and I want to check if I've missed something as part of the upgrade.
This is the existing DB schema which was created pre 1.3.1:
This is causing me problems where I had existing code that was doing something like thing.filenames + params[:filenames] because it is now trying to use + on nil. I know I can cast using Array(thing.filenames) but wanted to see if there was reason for this change or whether I need to do something else in my code?
The text was updated successfully, but these errors were encountered:
schinery
changed the title
Different behaviour for mount_uploaders mount_on blank values between 1.3.1 and 2.1.0
Different behaviour for mount_on with blank values between 1.3.1 and 2.1.0
Sep 24, 2020
I've just been upgrading some projects that use Carrierwave, and have stumbled upon a change in behaviour that is causing me some problems, and I want to check if I've missed something as part of the upgrade.
This is the existing DB schema which was created pre 1.3.1:
This is the existing model that has the
mount_uploaders
added to it:In Carrierwave 1.3.1 if I was to find a
Thing
object with no filenames currently set it would return a blank array on the object.In 2.1.0 though, it returns
filenames
asnil
.This is causing me problems where I had existing code that was doing something like
thing.filenames + params[:filenames]
because it is now trying to use+
onnil
. I know I can cast usingArray(thing.filenames)
but wanted to see if there was reason for this change or whether I need to do something else in my code?The text was updated successfully, but these errors were encountered: