Sha256: bdfed9a63900ded04e6c5d521d41568c10e68ae70831fee0a557971bfa5a0873
Contents?: true
Size: 777 Bytes
Versions: 19
Compression:
Stored size: 777 Bytes
Contents
require 'uri' class Caboose::MediaImage < ActiveRecord::Base self.table_name = "media_images" belongs_to :media_category has_attached_file :image, :path => 'media-images/:id_:style.:extension', :default_url => "#{Caboose::cdn_domain}/media-images/default_user_image.jpg", :styles => { :tiny => '150x200>', :thumb => '300x400>', :large => '600x800>' } do_not_validate_attachment_file_type :image attr_accessible :id, :media_category_id, :name, :description def process puts "http://#{Caboose::cdn_domain}/media-images/#{self.id}#{File.extname(self.name.downcase)}" self.image = URI.parse("http://#{Caboose::cdn_domain}/media-images/#{self.id}#{File.extname(self.name.downcase)}") self.save end end
Version data entries
19 entries across 19 versions & 1 rubygems