Parent

Class/Module Index [+]

Quicksearch

Foto

Schema Information

Table name: fotos

id         :integer          not null, primary key
title      :string(255)
desc       :text
gallery_id :integer
datei      :string(255)
created_at :datetime         not null
updated_at :datetime         not null

Public Instance Methods

parse_exif() click to toggle source
# File app/models/foto.rb, line 32
def parse_exif
  unless self.exif.nil? || self.exif.empty?
    j=JSON.parse(self.exif)
    datetime = j.select {|i| i.first == "DateTime"}.try(:first).try(:last)
    self.taken_at=Time.new(datetime) unless datetime.nil?
  end
end
to_jq_upload() click to toggle source
# File app/models/foto.rb, line 20
  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.