Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add rake task to generate slugs

  • Loading branch information...
commit e3338d56cec77ebfab6afe6c01a82b92c18f3274 1 parent 1de1128
@brentvatne brentvatne authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 Rakefile
View
7 Rakefile
@@ -5,3 +5,10 @@ require File.expand_path('../config/application', __FILE__)
require 'rake'
Puzzlenode::Application.load_tasks
+
+task :generate_slugs => :environment do
+ Puzzle.all.each do |puzzle|
+ puzzle.slug = Slugger.generate(puzzle.name)
+ puzzle.save!
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.