Guest User

Untitled

a guest
Aug 9th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.32 KB | None | 0 0
  1.  task :password_change => :environment do
  2.     puts "changing passwords..."
  3.  
  4.     User.all.each { |user|
  5.  
  6.       user.password = "123456"
  7.       if user.secondary
  8.         s = user.secondary
  9.         s.password = "123456"
  10.         s.save!
  11.       end
  12.       user.save!
  13.  
  14.     }
  15.  
  16.     puts "the password was changed!"
  17.  
  18.   end
Advertisement
Add Comment
Please, Sign In to add comment