Sha256: 0428827342409ef3dbdfe85cb9a7fa1260dd4c8ec2075ca0716cb4181dcd0bb8
Contents?: true
Size: 378 Bytes
Versions: 43
Compression:
Stored size: 378 Bytes
Contents
namespace :spree do desc "Resets all taxon permalinks" task reset_taxon_permalinks: :environment do Spree::Taxon.where(parent_id: nil).each { |taxon| redo_permalinks(taxon) } end def redo_permalinks(taxon) taxon.permalink = nil puts "#{taxon.permalink} => #{taxon.set_permalink}" taxon.save taxon.children.each { |t| redo_permalinks(t) } end end
Version data entries
43 entries across 43 versions & 1 rubygems