class Paperclip::ActiveAdminJcropper

Public Instance Methods

crop_params() click to toggle source
# File lib/active_admin_jcrop/asset_engine/paperclip.rb, line 52
def crop_params
  target = @attachment.instance
  "'#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i}'"
end
transformation_command() click to toggle source
Calls superclass method
# File lib/active_admin_jcrop/asset_engine/paperclip.rb, line 39
def transformation_command
  if @attachment.instance.active_admin_cropping?
    ary = super
    if i = ary.index('-crop')
      ary.delete_at i+1
      ary.delete_at i
    end
    ['-crop', crop_params] + ary
  else
    super
  end
end