Module: HasPermalink::ClassMethods

Defined in:
lib/has_permalink.rb

Instance Method Summary collapse

Instance Method Details

Makes it possible to generate permalinks for all instances of self:

Product.generate_permalinks

25
26
27
28
29
30
# File 'lib/has_permalink.rb', line 25

def generate_permalinks
  self.all.each do |item|
    item.generate_permalink
    item.save
  end
end