* Rename find_or_create to upsert and improve validation and testing * Add User.authenticated_through? * Refactor settings/integrations * Refactor profile github repositories rendering * Refactor repos fetching * Only fetch a single repo and improve error messages * Remove unused code * Cleanups * Fix specs * Remove trailing whitespace * Fix spec * Trigger Travis
13 lines
285 B
Ruby
13 lines
285 B
Ruby
class GithubRepoPolicy < ApplicationPolicy
|
|
def index?
|
|
!user_is_banned? && user.authenticated_through?(:github)
|
|
end
|
|
|
|
def update_or_create?
|
|
!user_is_banned? && user.authenticated_through?(:github)
|
|
end
|
|
|
|
def permitted_attributes
|
|
%i[github_id_code featured]
|
|
end
|
|
end
|