Module: ImageCropper

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/image_cropper.rb

Instance Method Summary collapse

Instance Method Details

#crop_imageObject

This simply makes carrierwave and rmagick recreate all its versions. We only call it if the ‘crop_x` attribute is present, as we use that as our trigger. Otherwise, we’re recreating versions without changing anything.



20
21
22
# File 'app/models/concerns/image_cropper.rb', line 20

def crop_image
  filename.recreate_versions! if crop_x.present?
end