OSDN Git Service

Fixing requests tests.
authorJakub Troszok <troszok@gmail.com>
Tue, 26 Jun 2012 22:55:54 +0000 (00:55 +0200)
committerJakub Troszok <troszok@gmail.com>
Tue, 26 Jun 2012 22:55:54 +0000 (00:55 +0200)
app/models/user.rb
app/views/admin/users/_form.html.haml

index 6975092..02bfabe 100644 (file)
@@ -59,7 +59,7 @@ class User < ActiveRecord::Base
   before_validation :generate_password, :on => :create
 
   def generate_password
-    if self.force_random_password == true
+    if self.force_random_password
       self.password = self.password_confirmation = Devise.friendly_token.first(8)
     end
   end
index 1e8a44e..bd2e136 100644 (file)
@@ -23,7 +23,7 @@
         -if f.object.new_record?
           .clearfix 
             = f.label :admin, :class => "checkbox" do
-              = f.check_box :force_random_password
+              = f.check_box :force_random_password, {}, true, nil
             %span Generate random password
         
         %div.password-fields