Simplify project check with duck typing

This commit is contained in:
Oswaldo Ferreira 2018-02-22 13:55:35 -03:00
parent a8c523d98b
commit 31d1b2ca8c
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ module ApplicationHelper
def project_icon(project_id, options = {})
project =
if project_id.is_a?(Project) || project_id.is_a?(ProjectPresenter)
if project_id.respond_to?(:avatar_url)
project_id
else
Project.find_by_full_path(project_id)