Class: Ecm::Downloads::DownloadCategory
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::Downloads::DownloadCategory
- Extended by:
- FriendlyId
- Defined in:
- app/models/ecm/downloads/download_category.rb
Instance Method Summary collapse
-
#display_code ⇒ Object
public methods.
- #index_name ⇒ Object
- #to_s ⇒ Object
- #tree_name ⇒ Object
Instance Method Details
#display_code ⇒ Object
public methods
39 40 41 |
# File 'app/models/ecm/downloads/download_category.rb', line 39 def display_code "<%= render_download_category '#{self.name}' %>" end |
#index_name ⇒ Object
43 44 45 46 47 48 49 |
# File 'app/models/ecm/downloads/download_category.rb', line 43 def index_name if self.root? "[#{self.locale}] #{self.name}" else "#{'    ' * self.level} |-- #{self.name}".html_safe end end |
#to_s ⇒ Object
51 52 53 |
# File 'app/models/ecm/downloads/download_category.rb', line 51 def to_s name end |
#tree_name ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'app/models/ecm/downloads/download_category.rb', line 55 def tree_name root_prefix = (self.root?) ? "[#{self.locale}] " : "" if ecm_downloads_downloads_count < 1 "#{root_prefix}#{to_s}" else "#{root_prefix}#{to_s} (#{ecm_downloads_downloads_count})" end end |