diff --git a/lib/cloudinary/carrier_wave/process.rb b/lib/cloudinary/carrier_wave/process.rb index 54e9aea0..5ee32889 100644 --- a/lib/cloudinary/carrier_wave/process.rb +++ b/lib/cloudinary/carrier_wave/process.rb @@ -163,7 +163,7 @@ def store!(new_file=nil) super column = model.send(:_mounter, mounted_as).send(:serialization_column) - identifier = model.send(:attribute, column) + identifier = model.read_attribute(column) retrieve_from_store!(identifier) unless identifier.nil? end end diff --git a/spec/carriewave.rb b/spec/carriewave_spec.rb similarity index 91% rename from spec/carriewave.rb rename to spec/carriewave_spec.rb index 318b6595..db26b85f 100644 --- a/spec/carriewave.rb +++ b/spec/carriewave_spec.rb @@ -25,7 +25,7 @@ class SanitizedFile; end subject { uploader.store! } it 'triggers `#retrieve_from_store!` after `#store!` executed to populate @file and @identifier' do - expect(model).to receive(:attribute).with(column).and_return(identifier) + expect(model).to receive(:read_attribute).with(column).and_return(identifier) expect(uploader).to receive(:retrieve_from_store!).with(identifier) subject