Skip to content

Commit

Permalink
Fix: stop empty nicknames from rendering in student_name (#364)
Browse files Browse the repository at this point in the history
refactor ternary operator which creates student_name to ensure nicknames with a value of "" are not rendered
  • Loading branch information
lindenhutchinson authored Mar 16, 2022
1 parent c44915a commit b1a6035
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/entities/project_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ProjectEntity < Grape::Entity
end
expose :campus_id
expose :student_name do |project, options|
"#{project.student.name}#{project.student.nickname.nil? ? '' : ' (' << project.student.nickname << ')'}"
"#{project.student.name}#{project.student.nickname.blank? ? '' : ' (' << project.student.nickname << ')'}"
end
expose :enrolled
expose :target_grade
Expand Down

0 comments on commit b1a6035

Please sign in to comment.