Permalink
Browse files

added rake task to copy user levels to the official list

  • Loading branch information...
Evan Wallace
Evan Wallace committed Feb 25, 2011
1 parent fade521 commit 082576a83a0bfb3dee95ce69679979dbddb03c7f
Showing with 10 additions and 1 deletion.
  1. +1 −1 .gitignore
  2. 0 rails/db/test.sqlite3
  3. +9 −0 rails/lib/tasks/levels.rake
View
@@ -20,4 +20,4 @@ level_converter/level_converter
# rails stuff
rails/tmp/
rails/log/
-rails/db/development.sqlite3
+*.sqlite3
View
No changes.
@@ -0,0 +1,9 @@
+namespace :levels do
+
+ desc 'rake "levels:make_official[username,levelname]"'
+ task :make_official, [:username, :level] => :environment do |t, args|
+ official = User.find_by_username('rapt')
+ user = User.find_by_username(args.username)
+ level = official.levels.create(user.levels.find_by_title(args.level).attributes)
+ end
+end

0 comments on commit 082576a

Please sign in to comment.