1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

sign_in_count shoud default to zero.

This commit is contained in:
José Valim 2010-03-26 12:55:37 +01:00
parent 6f41284714
commit bd4b29c0fd
2 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ module Devise
# Creates sign_in_count, current_sign_in_at, last_sign_in_at,
# current_sign_in_ip, last_sign_in_ip.
def trackable
apply_schema :sign_in_count, Integer
apply_schema :sign_in_count, Integer, :default => 0
apply_schema :current_sign_in_at, DateTime
apply_schema :last_sign_in_at, DateTime
apply_schema :current_sign_in_ip, String
@ -54,7 +54,7 @@ module Devise
# Creates failed_attempts, unlock_token and locked_at
def lockable
apply_schema :failed_attempts, Integer, :default => 0
apply_schema :unlock_token, String, :limit => 20
apply_schema :unlock_token, String, :limit => 20
apply_schema :locked_at, DateTime
end

View file

@ -39,7 +39,7 @@ class TrackableHooksTest < ActionController::IntegrationTest
test "increase sign in count" do
user = create_user
assert_nil user.sign_in_count
assert_equal 0, user.sign_in_count
sign_in_as_user
user.reload