Skip to content

Remove with_username completely #270

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

Merged
merged 2 commits into from
Dec 26, 2014

Conversation

rohitpaulk
Copy link
Contributor

https://assembly.com/coderwall/bounties/479

This PR replaces the with_username function with find_by_username when it searches only by the internal username (coderwall username), and with from_elsewhere_username when it searches by an external username.

@@ -126,23 +126,13 @@ def near
#TODO Kill
scope :username_in, ->(usernames) { where(["UPPER(username) in (?)", usernames.collect(&:upcase)]) }

#TODO Kill
def self.with_username(username, provider = :username)
def self.from_elsewhere_username(username, provider='')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we think about another method name ? also provider is not optional in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we think about another method name ?

Sure, find_by_external_username?

provider is not optional in this case.

True, let me change that.

@rohitpaulk rohitpaulk closed this Dec 23, 2014
@rohitpaulk rohitpaulk reopened this Dec 23, 2014
@rohitpaulk
Copy link
Contributor Author

Travis failed due to a connection timeout, so I closed and opened the PR to restart the build.

seuros added a commit that referenced this pull request Dec 26, 2014
@seuros seuros merged commit 50bf058 into coderwall:master Dec 26, 2014
seuros pushed a commit to seuros/coderwall that referenced this pull request Mar 1, 2015
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