Sha256: e488710b65390cb7c0036305878de0e2cf8df7096c7cff53bafaf96d820b0993

Contents?: true

Size: 774 Bytes

Versions: 31

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::ParticipantFormFieldDecorator < ::Tramway::Core::ApplicationDecorator
  class << self
    def collections
      [:all]
    end

    def list_attributes
      [:event_title]
    end

    def show_attributes
      %i[id title description field_type event_title state created_at updated_at options position]
    end
  end

  delegate_attributes :description, :options, :position

  def title
    "#{object.title} #{object.event.title}"
  end

  def event_title
    object.event.title
  end

  def field_type
    enumerize_view object.field_type
  end

  def state
    state_machine_view object, :state
  end

  def created_at
    date_view object.created_at
  end

  def updated_at
    date_view object.updated_at
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
tramway-event-1.12.9.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.9 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.8.2 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.8.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.8 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.7 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.6.4 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.6.3 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.6.2 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.6 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.5 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.4 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.10 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.9 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.8 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.7 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.6 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.5 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.4 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.3 app/decorators/tramway/event/participant_form_field_decorator.rb