Class: Index

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Includes:
ActsAsPrioritizable
Defined in:
app/models/index.rb

Instance Method Summary collapse

Instance Method Details

#assetsObject



37
38
39
# File 'app/models/index.rb', line 37

def assets
  (texts + photos + videos + downloadables).sort_by{|a| a.priority || 99}
end

#default_nameObject



41
42
43
44
# File 'app/models/index.rb', line 41

def default_name
  self.name ||= (self.title ||= self.owner.name).tableize rescue nil
  self.title ||= self.name.titleize rescue nil
end