Class: Category

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/category.rb

Instance Method Summary collapse

Instance Method Details

#generate_url_if_neededObject



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_productsObject

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