OSDN Git Service

Implementing automatic password generation.
authorJakub Troszok <troszok@gmail.com>
Sun, 24 Jun 2012 20:38:29 +0000 (22:38 +0200)
committerJakub Troszok <troszok@gmail.com>
Sun, 24 Jun 2012 20:38:29 +0000 (22:38 +0200)
app/models/user.rb

index 484853b..4367c0c 100644 (file)
@@ -53,7 +53,7 @@ class User < ActiveRecord::Base
   scope :blocked, where(:blocked =>  true)
   scope :active, where(:blocked =>  false)
 
-  before_validation :generate_password, :on1 => :create
+  before_validation :generate_password, :on => :create
 
   def generate_password
     if self.password.blank? && self.password_confirmation.blank?