Sha256: 489c8f8da34d474d61f46e86b65c77572e6ed7504b8b1cb44b90c83c12cec3a4

Contents?: true

Size: 690 Bytes

Versions: 24

Compression:

Stored size: 690 Bytes

Contents

class Ckeditor::Picture < Ckeditor::Asset
  has_attachment :content_type => :image, 
                 :storage => :file_system, :path_prefix => 'public/assets/pictures',
                 :max_size => 2.megabytes,
                 :size => 0.kilobytes..2000.kilobytes,
                 :processor => 'Rmagick',
                 :thumbnails => { :content => '575>', :thumb => '100x100!' }
                 
	validates_as_attachment
  
  def url_content
	  public_filename(:content)
	end
	
	def url_thumb
	  public_filename(:thumb)
	end
	
	def to_json(options = {})
	  options[:methods] ||= []
	  options[:methods] << :url_content
	  options[:methods] << :url_thumb
	  super options
  end
end

Version data entries

24 entries across 24 versions & 5 rubygems

Version Path
ckeditor-3.4.0.pre lib/generators/ckeditor/migration/templates/models/attachment_fu/picture.rb
ckeditor-3.3.2 generators/ckeditor_migration/templates/models/attachment_fu/picture.rb
ckeditor-3.2.4 lib/generators/templates/models/attachment_fu/picture.rb
ckeditor-3.2.3 lib/generators/templates/models/attachment_fu/picture.rb