Class: Ecm::Links::Category
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::Links::Category
- Extended by:
- FriendlyId
- Defined in:
- app/models/ecm/links/category.rb
Class Method Summary collapse
Instance Method Summary collapse
- #human ⇒ Object
- #links_count ⇒ Object
- #long_description(options = {}) ⇒ Object
- #short_description(options = {}) ⇒ Object
- #to_s ⇒ Object
Class Method Details
.for_actual_locale ⇒ Object
38 39 40 |
# File 'app/models/ecm/links/category.rb', line 38 def self.for_actual_locale where(locale: I18n.locale) end |
.for_link_footer ⇒ Object
42 43 44 |
# File 'app/models/ecm/links/category.rb', line 42 def self. where(arel_table['link_footer_column'].not_eq(nil)).for_actual_locale end |
Instance Method Details
#human ⇒ Object
30 31 32 |
# File 'app/models/ecm/links/category.rb', line 30 def human name end |
#links_count ⇒ Object
66 67 68 |
# File 'app/models/ecm/links/category.rb', line 66 def links_count links.count end |
#long_description(options = {}) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'app/models/ecm/links/category.rb', line 46 def long_description( = {}) .reverse_merge!(as: :plain) case [:as] when :html markup(self[:long_description]) else self[:long_description] end end |
#short_description(options = {}) ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'app/models/ecm/links/category.rb', line 56 def short_description( = {}) .reverse_merge!(as: :plain) case [:as] when :html markup(self[:short_description]) else self[:short_description] end end |
#to_s ⇒ Object
34 35 36 |
# File 'app/models/ecm/links/category.rb', line 34 def to_s human end |