Sha256: 439c8333fefa535fe8d8a33e21914d6b7a5d5353ff63331676b2cd591a686c97
Contents?: true
Size: 409 Bytes
Versions: 98
Compression:
Stored size: 409 Bytes
Contents
# frozen_string_literal: true 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
98 entries across 98 versions & 2 rubygems