Method: Elabs::ContentHelper#first_type_with_content

Defined in:
app/helpers/elabs/content_helper.rb

#first_type_with_content(entity) ⇒ Object



11
12
13
14
15
16
# File 'app/helpers/elabs/content_helper.rb', line 11

def first_type_with_content(entity)
  %i[albums articles notes projects uploads].each do |type|
    return type.to_s if entity.respond_to?(type) && entity["#{type}_count"].positive?
  end
  'albums'
end