task dedigest_assets: :environment do
  extensions = %w[jpg png js css gif]
  Dir.glob(Rails.root.join('public/assets/**', "*.{#{extensions.join(',')}}")).each do |asset_path|
   next unless asset_path =~ /-[a-f0-9]{32}\.(#{extensions.join('|')})\Z/
   dedigest_path = asset_path.sub(/-[a-f0-9]{32}/, '')
   `cp '#{asset_path}' '#{dedigest_path}' 2>/dev/null`
  end
end
