diff --git a/lib/carrierwave/mount.rb b/lib/carrierwave/mount.rb index 88db5a299..bea59955e 100644 --- a/lib/carrierwave/mount.rb +++ b/lib/carrierwave/mount.rb @@ -296,11 +296,13 @@ def initialize(record, column, options={}) end def write_identifier - return if record.frozen? || uploader.identifier.blank? + return if record.frozen? - value = remove? ? '' : uploader.identifier - - record.write_uploader(serialization_column, value) + if remove? + record.write_uploader(serialization_column, '') + elsif not uploader.identifier.blank? + record.write_uploader(serialization_column, uploader.identifier) + end end def identifier