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.3.2 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.3 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.2 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.1.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12.0.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.12 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.11.5.1 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.11.5 app/decorators/tramway/event/participant_form_field_decorator.rb
tramway-event-1.11.4.1 app/decorators/tramway/event/participant_form_field_decorator.rb