-
Notifications
You must be signed in to change notification settings - Fork 22
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
Dev signup #66
Dev signup #66
Conversation
To test "sign in with developer strategy."
Oops, I need to describe about this patch. |
@@ -5,7 +5,7 @@ class User < ActiveRecord::Base | |||
|
|||
validates :provider, presence: true, inclusion: { in: Settings.providers } | |||
validates :name, presence: true, uniqueness: true, length: { maximum: 40 } | |||
validates :uid, presence: true, format: { with: /\A[0-9]+\Z/ } | |||
validates :uid, presence: true, uniqueness: true, format: { with: /\A[0-9]+\Z/ } |
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.
Is it necessary? This uniqueness should be ensured by provider
and uid
.
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.
Oh, sorry, I have missed that the key for users
table is composite.
I added scope instead of remove it because
messages from ActiveRecord validations are very helpful for end users.
The patch looks almost good. Some remains being fixed, I'll merge it. |
@@ -5,7 +5,9 @@ class User < ActiveRecord::Base | |||
|
|||
validates :provider, presence: true, inclusion: { in: Settings.providers } | |||
validates :name, presence: true, uniqueness: true, length: { maximum: 40 } | |||
validates :uid, presence: true, format: { with: /\A[0-9]+\Z/ } | |||
validates :uid, presence: true, format: { with: /\A[0-9]+\Z/ }, | |||
uniqueness: {scope: :provider, |
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.
Oh, I hadn't known that we could write like this!
Thanks!!1 |
Thanks reviewing and merging. |
Commits for #53
I make a proposal on only functionality.
I know putting two long text links in
/caveat
and global nav but I think it should be discussed and patched in another issue.I'm glad if you consider this patch.
Thanks.