Sha256: 8571e0a12c51680385be66ffcd7b4bf96d3b6e941e0546a4ca2b653e819c9645
Contents?: true
Size: 940 Bytes
Versions: 17
Compression:
Stored size: 940 Bytes
Contents
class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator class << self def collections [ :all ] end end delegate :title, to: :object delegate :description, to: :object decorate_association :participants decorate_association :participant_form_fields decorate_association :sections decorate_association :partakings def background object.photo end def duration if object.begin_date.to_date == object.end_date.to_date "#{I18n.l(object.begin_date, format: '%d %B %Y')}" elsif object.begin_date.month == object.end_date.month "#{I18n.t('date.from')} #{I18n.l(object.begin_date, format: '%d')} #{I18n.t('date.to')} #{I18n.l(object.end_date, format: '%d %B %Y')}" else "#{I18n.t('date.from')} #{I18n.l(object.begin_date, format: '%d %B %Y')} #{I18n.t('date.to')} #{I18n.l(object.end_date, format: '%d %B %Y')}" end end alias tagline duration end
Version data entries
17 entries across 17 versions & 1 rubygems