diff options
author | ankonym <ankonym@gmail.com> | 2015-08-24 16:08:57 +0200 |
---|---|---|
committer | ankonym <ankonym@gmail.com> | 2015-09-28 15:12:45 +0200 |
commit | 5f9aec72f124a971b765c14052363f3ce1e16c65 (patch) | |
tree | 26b5ed1daca8340cd6315462b37fa7566c2999cf /lib/tasks | |
parent | 0543217b433a8f4809f08018c1a11c20119fa85d (diff) |
Add rake task for invite code batch generation
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/invite_code.rake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/invite_code.rake b/lib/tasks/invite_code.rake new file mode 100644 index 0000000..f3bafac --- /dev/null +++ b/lib/tasks/invite_code.rake @@ -0,0 +1,16 @@ + + +desc "Generate a batch of invite codes" +task :generate_invites, [:n] => :environment do |task, args| + + codes = args.n + codes = codes.to_i + + codes.times do |x| + x = InviteCode.new + x.save + puts "#{x.invite_code} Code generated." + + end +end + |