Skip to content

Commit

Permalink
added rake task to copy user levels to the official list
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Wallace committed Feb 25, 2011
1 parent fade521 commit 082576a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -20,4 +20,4 @@ level_converter/level_converter
# rails stuff
rails/tmp/
rails/log/
rails/db/development.sqlite3
*.sqlite3
Empty file removed rails/db/test.sqlite3
Empty file.
9 changes: 9 additions & 0 deletions rails/lib/tasks/levels.rake
@@ -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.