Class: Presentation

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/presentation.rb

Constant Summary collapse

UPLOAD_BASE_DIR =
File.join(Rails.root, "uploaded_presentations")
INDEX_FILENAME =
"index.html"
UNPACKED_DIRNAME =
"unpacked"

Instance Method Summary collapse

Instance Method Details

#index_pathObject



23
24
25
# File 'app/models/presentation.rb', line 23

def index_path
  File.join(path_without_upload_base_dir, UNPACKED_DIRNAME, INDEX_FILENAME)
end


31
32
33
# File 'app/models/presentation.rb', line 31

def permalink
  friendly_id
end

#to_sObject



35
36
37
# File 'app/models/presentation.rb', line 35

def to_s
  title
end

#x_accel_redirect_path_to(some_asset) ⇒ Object



27
28
29
# File 'app/models/presentation.rb', line 27

def x_accel_redirect_path_to(some_asset)
  some_asset.blank? ? index_path : File.join(path_without_upload_base_dir, UNPACKED_DIRNAME, *some_asset)
end