diaspora/app/presenters/profile_presenter.rb
Florian Staudacher 1f724dd123 * add a (hash)tag helper for handlebars
* re-add stream on profile page
* more controller refactoring
2014-09-15 01:37:23 +02:00

24 lines
461 B
Ruby

class ProfilePresenter < BasePresenter
include PeopleHelper
def base_hash
{ id: id,
tags: tags.pluck(:name),
bio: bio,
location: location,
gender: gender,
birthday: formatted_birthday,
searchable: searchable
}
end
def full_hash
base_hash.merge({
avatar: AvatarPresenter.new(@presentable).base_hash,
})
end
def formatted_birthday
birthday_format(birthday) if birthday
end
end