-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix login failure #43
Conversation
It's obviously another account. I do not prefer this changes because it can cause unintended consequence. |
01cf9a0
to
ae49794
Compare
Yes, I know it as ideal. The reason for taking this approach is
But I agree this approach is not good. So I redoed it ae49794 (Removing table constaints) |
It doesn't look bad 👍 |
ae49794
to
0e362cb
Compare
@@ -0,0 +1,6 @@ | |||
class DropUniqConstraintUserEmail < ActiveRecord::Migration | |||
def change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be def up
because this migration is irreversible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! fixed e803981
0e362cb
to
e803981
Compare
app/models/kuroko2/user.rb
Outdated
@@ -17,8 +17,8 @@ class Kuroko2::User < Kuroko2::ApplicationRecord | |||
has_many :admin_assignments, dependent: :restrict_with_error | |||
has_many :assigned_job_definitions, through: :admin_assignments, source: :job_definition | |||
|
|||
validates :name, uniqueness: { case_sensitive: false} , presence: true | |||
validates :email, uniqueness: { case_sensitive: false}, presence: true | |||
validates :name, uniqueness: { case_sensitive: false }, presence: true, unless: :google_account? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The presence should be validated even if google_account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 149ea35
With a user who email address already exists, But defferrent `uid`
e803981
to
149ea35
Compare
With a user who email address already exists, but different uid.
@cookpad/dev-infra 👓