Class: Shoppe::ProductCategory
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Shoppe::ProductCategory
- Defined in:
- app/models/shoppe/product_category.rb
Instance Method Summary collapse
- #combined_permalink ⇒ Object
-
#hierarchy_array ⇒ Object
Return array with all the product category parents hierarchy in descending order.
Instance Method Details
#combined_permalink ⇒ Object
39 40 41 42 43 44 45 |
# File 'app/models/shoppe/product_category.rb', line 39 def combined_permalink if self.permalink_includes_ancestors && self.ancestral_permalink.present? "#{self.ancestral_permalink}/#{self.permalink}" else self.permalink end end |
#hierarchy_array ⇒ Object
Return array with all the product category parents hierarchy in descending order
49 50 51 52 |
# File 'app/models/shoppe/product_category.rb', line 49 def hierarchy_array return [self] unless parent parent.hierarchy_array.concat [self] end |