Skip to content
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

Merged
merged 11 commits into from
Jan 21, 2013
Merged

Dev signup #66

merged 11 commits into from
Jan 21, 2013

Conversation

KitaitiMakoto
Copy link
Collaborator

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.

@KitaitiMakoto
Copy link
Collaborator Author

Oops, I need to describe about this patch.
It adds links "sign in with developer strategy" when environment is development.
By following the link, you can create a user for development environment.

@@ -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/ }
Copy link
Owner

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.

Copy link
Collaborator Author

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.

@kentaro
Copy link
Owner

kentaro commented Jan 20, 2013

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,
Copy link
Owner

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!

kentaro added a commit that referenced this pull request Jan 21, 2013
@kentaro kentaro merged commit 29c09b8 into kentaro:master Jan 21, 2013
@kentaro
Copy link
Owner

kentaro commented Jan 21, 2013

Thanks!!1

@KitaitiMakoto
Copy link
Collaborator Author

Thanks reviewing and merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants