Class: Category
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Category
- Defined in:
- app/models/category.rb
Instance Method Summary collapse
- #generate_url_if_needed ⇒ Object
-
#shop_products ⇒ Object
just a shorthand to apply Products.shop_products scope to the groups products.
Instance Method Details
#generate_url_if_needed ⇒ Object
18 19 20 21 22 23 |
# File 'app/models/category.rb', line 18 def generate_url_if_needed if self.link.blank? && self.name != nil self.link = self.name.gsub(" " , "_").downcase end true end |
#shop_products ⇒ Object
just a shorthand to apply Products.shop_products scope to the groups products
26 27 28 |
# File 'app/models/category.rb', line 26 def shop_products products.shop_products end |