Skip to content

Commit 5a24d0a

Browse files
committed
script to add confirmation keys
1 parent 99154ed commit 5a24d0a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

script/add-confirm-keys

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env ruby
2+
# ruby script/add-confirm-keys > tmp/confirm-keys.txt
3+
4+
require 'rubygems'
5+
require 'active_support'
6+
require 'fastercsv'
7+
require 'mongo'
8+
9+
db = Mongo::Connection.new.db "nodeknockout"
10+
@people = db.collection 'Person'
11+
12+
@people.find( :confirmed => false ).each do |person|
13+
person['confirmKey'] = ActiveSupport::SecureRandom.hex
14+
@people.save person
15+
puts [person['email'], person['_id'], person['confirmKey']].to_csv
16+
end

0 commit comments

Comments
 (0)