module Write module ApplicationHelper def write_admin? login_user && Write.admin?(login_user.github) end def login_user defined?(current_user) && current_user end def timestamp_display post words = time_ago_in_words(post.created_at) + " ago" if post.updated? words << " (Updated #{time_ago_in_words(post.updated_at)} ago)" end words end end end