Sha256: ab7d24bd9e0eb1546ce0f9401554567bcb72946f37d9eb9b43b157c36e4fac54
Contents?: true
Size: 696 Bytes
Versions: 13
Compression:
Stored size: 696 Bytes
Contents
class Image::Base < ActiveRecord::Base self.table_name = "images" mount_uploader :image, ImageUploader attr_accessor :crop_x, :crop_y, :crop_w, :crop_h # Associations belongs_to :imageable, :polymorphic => true # Callbacks after_save :crop_image def crop_image image.recreate_versions! if crop_x.present? end #one convenient method to pass jq_upload the necessary information def to_jq_upload { "name" => read_attribute(:image), "size" => image.size, "full_url" => image.url, "thumbnail_url" => image.thumb.url, "large_url" => image.large.url, "url" => "/admin/images/#{id}", "delete_type" => "DELETE" } end end
Version data entries
13 entries across 13 versions & 1 rubygems