Class: Photo

Inherits:
Object
  • Object
show all
Includes:
Ish::Utils, Mongoid::Document, Mongoid::Paperclip, Mongoid::Timestamps
Defined in:
lib/photo.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Ish::Utils

#export

Class Method Details



57
58
59
# File 'lib/photo.rb', line 57

def self.n_per_manager_gallery
  25
end

Instance Method Details

#export_fieldsObject



61
62
63
64
65
66
67
68
# File 'lib/photo.rb', line 61

def export_fields
  %w|
    gallery_id
    name descr weight is_public is_trash

    photo_file_name photo_content_type photo_file_size photo_updated_at photo_fingerprint
  |
end

#nameObject



24
25
26
27
28
# File 'lib/photo.rb', line 24

def name
  return self[:name] if self[:name]
  update_attribute(:name, self.photo.to_s.split('/').last.split('?').first)
  name
end

#userObject



12
13
14
# File 'lib/photo.rb', line 12

def user
  
end