Simplify project check with duck typing
This commit is contained in:
parent
a8c523d98b
commit
31d1b2ca8c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue