Skip to content

Commit

Permalink
[Refactor] Don't assign github client for user
Browse files Browse the repository at this point in the history
  • Loading branch information
tricknotes committed Oct 21, 2024
1 parent c435776 commit 5b9bbc3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class User < ActiveRecord::Base
attr_accessor :github_client

MAX_FOLLOWER_PAGE_COUNT = 50

scope :email_sendables, -> { where(subscribe: true, activation_state: 'active') }
Expand All @@ -24,8 +22,7 @@ class User < ActiveRecord::Base
class << self
def find_or_fetch_by_username(username)
self.find_by_username(username) || User.new {|user|
user.github_client = Settings.github_client
github_user = user.github_client.user(username)
github_user = Settings.github_client.user(username)
user.username = github_user.login
user.avatar_url = github_user.avatar_url
}
Expand Down

0 comments on commit 5b9bbc3

Please sign in to comment.