Class: EtabliocmsActualities::Category
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- EtabliocmsActualities::Category
- Defined in:
- app/models/etabliocms_actualities/category.rb
Instance Attribute Summary collapse
-
#child_of ⇒ Object
Returns the value of attribute child_of.
Instance Method Summary collapse
Instance Attribute Details
#child_of ⇒ Object
Returns the value of attribute child_of.
7 8 9 |
# File 'app/models/etabliocms_actualities/category.rb', line 7 def child_of @child_of end |
Instance Method Details
#other_categories_for_select ⇒ Object
20 21 22 23 24 |
# File 'app/models/etabliocms_actualities/category.rb', line 20 def other_categories_for_select categories = EtabliocmsActualities::Category.order("lft ASC") categories = categories.where("id != ?", id) unless new_record? categories.map { |d| [d.title, d.id] } end |
#path ⇒ Object
16 17 18 |
# File 'app/models/etabliocms_actualities/category.rb', line 16 def path self_and_ancestors.map(&:slug).join("/") end |