education/classroom

View on GitHub
app/serializers/assignment_repo_serializer.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class AssignmentRepoSerializer < ActiveModel::Serializer
  attributes :id
  attributes :username
  attributes :displayName

  def username
    object.user.github_user.login
  end

  # rubocop:disable MethodName
  def displayName
    object.user.github_user.name || ""
  end
  # rubocop:enable MethodName
end