Skip to content

Commit a8f8c0e

Browse files
committed
use github_id instead of login
1 parent 4261203 commit a8f8c0e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

app/jobs/extract_github_profile.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ def perform(id)
1414
end
1515
profile = Users::Github::Profile.find(id)
1616
begin
17-
#TODO use github_id instead of login
18-
user = client.user(profile.login)
17+
user = client.user(profile.github_id)
1918
#TODO Rails4
2019
profile.update_attributes(
2120
{

app/models/users/github/profile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Profile < ActiveRecord::Base
2727
foreign_key: :follower_id , dependent: :delete_all
2828
has_many :repositories, class_name: 'Users::Github::Repository',
2929
foreign_key: :owner_id
30-
validates :login , presence: true, uniqueness: true
30+
validates :github_id , presence: true, uniqueness: true
3131
before_validation :copy_login_from_user, on: :create
3232
after_create :extract_data_from_github
3333

0 commit comments

Comments
 (0)