Sha256: 3f9220447fac097e13353c4fa57bf8ec2aacc85d61fec86ab57f6d9a49d1a525

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

module C80Catoffers

  # грузит картинку услуги
  class OphotoUploader < BaseFileUploader

    process :resize_to_limit => [1024,768]

    version :thumb_big_one do
      Proc.new {
        p = C80Catoffers::Prop.first
        process :resize_to_fill => [p.big_one_width, p.big_one_height]
      }
    end

    version :thumb_preview do
      Proc.new {
        p = C80Catoffers::Prop.first
        process :resize_to_fill => [p.preview_width, p.preview_height]
      }
    end

    version :thumb_sm do
      Proc.new {
        p = C80Catoffers::Prop.first
        process :resize_to_fill => [p.thumb_sm_width, p.thumb_sm_height]
      }
    end

    version :thumb_md do
      Proc.new {
        p = C80Catoffers::Prop.first
        process :resize_to_fill => [p.thumb_md_width, p.thumb_md_height]
      }
    end

    version :thumb_lg do
      Proc.new {
        p = C80Catoffers::Prop.first
        process :resize_to_fill => [p.thumb_lg_width, p.thumb_lg_height]
      }
    end

    def store_dir
      'uploads/oimages'
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
c80_catoffers-0.1.0.4 app/uploaders/c80_catoffers/ophoto_uploader.rb
c80_catoffers-0.1.0.3 app/uploaders/c80_catoffers/ophoto_uploader.rb