Parent

Class/Module Index [+]

Quicksearch

Attachment

Schema Information

Table name: attachments

id         :integer          not null, primary key
name       :string(255)
datei      :string(255)
created_at :datetime         not null
updated_at :datetime         not null
thema_id   :integer

Public Class Methods

parent_attachment_list_id(parent) click to toggle source
# File app/models/attachment.rb, line 29
def self.parent_attachment_list_id(parent)
  "attachments_for_"+parent.class.to_s+"_"+parent.id.to_s
end

Public Instance Methods

image?() click to toggle source
# File app/models/attachment.rb, line 23
 def image?
   
#   data_ext = datei.file.extension.downcase 
#   %w(jpg png jpeg).include?(data_ext)
   datei.image?(datei.file)
 end
to_jq_upload() click to toggle source
# File app/models/attachment.rb, line 33
def to_jq_upload
{
  "id" => read_attribute(:id),
  "title" => read_attribute(:title),
  "description" => read_attribute(:desc),
  "name" => read_attribute(:title),
  "size" => datei.size,
  "url" => datei.url,
  "thumbnail_url" => datei.thumb.url,
  "delete_type" => "DELETE" 
 }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.