Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #166 from ninech/bugfix-audit-log
Browse files Browse the repository at this point in the history
fixed migration mess
  • Loading branch information
pencil committed May 25, 2016
2 parents 5ca4e49 + 83f1f7c commit aab47a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 0 additions & 6 deletions app/models/casino/login_attempt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@ class CASino::LoginAttempt < ActiveRecord::Base
include CASino::ModelConcern::BrowserInfo

belongs_to :user

def username=(username)
super

self.user = CASino::User.find_by_username(username)
end
end
11 changes: 11 additions & 0 deletions db/migrate/20160524121117_remove_username_from_login_attempts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class RemoveUsernameFromLoginAttempts < ActiveRecord::Migration
def up
remove_column :casino_login_attempts, :username
change_column_null :casino_login_attempts, :user_id, false
end

def down
add_column :casino_login_attempts, :username, :string
change_column_null :casino_login_attempts, :user_id, true
end
end

0 comments on commit aab47a5

Please sign in to comment.