Sha256: 942089f64b01579dd51f1dad6a4e0a7e226fc6358bafaf6d53e734e3905beae2

Contents?: true

Size: 717 Bytes

Versions: 14

Compression:

Stored size: 717 Bytes

Contents

module Crimagify
  class Image < ActiveRecord::Base
  	require 'carrierwave/orm/activerecord'
  	extend Crimagify::DinamicImageMethods

  	mount_uploader :image, Crimagify::ImageUploader
		mount_uploader :image_temporal, Crimagify::ImageUploader

		belongs_to :parent, polymorphic: true
    attr_accessible :image, :image_name, :image_temporal, :parent_id, :parent_type, :crop_x, :crop_y, :crop_w, :crop_h

    attr_accessor :crop_x, :crop_y, :crop_w, :crop_h

    def crop_avatar_temporal
	  	if image_temporal.present? 		
	      image_temporal.recreate_versions! if crop_x.present?
	  	end
	  end

	  def crop_avatar_real
	    image.recreate_versions! if crop_x.present?
	  end

	  build_sizes_images
	  
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
crimagify-0.0.4.3 app/models/crimagify/image.rb
crimagify-0.0.4.2 app/models/crimagify/image.rb
crimagify-0.0.4.1 app/models/crimagify/image.rb
crimagify-0.0.4.0 app/models/crimagify/image.rb
crimagify-0.0.3.9 app/models/crimagify/image.rb
crimagify-0.0.3.8 app/models/crimagify/image.rb
crimagify-0.0.3.6 app/models/crimagify/image.rb
crimagify-0.0.3.5 app/models/crimagify/image.rb
crimagify-0.0.3.4 app/models/crimagify/image.rb
crimagify-0.0.3.3 app/models/crimagify/image.rb
crimagify-0.0.3.2 app/models/crimagify/image.rb
crimagify-0.0.3.1 app/models/crimagify/image.rb
crimagify-0.0.2.1 app/models/crimagify/image.rb
crimagify-0.0.2 app/models/crimagify/image.rb