Skip to content

Commit

Permalink
sign_in_count shoud default to zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Mar 26, 2010
1 parent 867e896 commit e2793fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/devise/schema.rb
Expand Up @@ -44,7 +44,7 @@ def rememberable
# 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
Expand All @@ -54,7 +54,7 @@ def trackable
# 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

Expand Down
2 changes: 1 addition & 1 deletion test/integration/trackable_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit e2793fc

Please sign in to comment.