dimanche 1 juin 2014

How to rewrite 'column => self[column]' field generic hash rocket to ruby 1.9 hash format


Vote count:

0




How can the below (specifically User.exists?(column => self[column])) be re-written in Ruby's 1.9 hash syntax?



def generate_token(column)
begin
self[column] = SecureRandom.urlsafe_base64
end while User.exists?(column => self[column])
end


asked 49 secs ago






Aucun commentaire:

Enregistrer un commentaire