Class: Tramway::Event::ParticipantFormFieldDecorator

Inherits:
Core::ApplicationDecorator
  • Object
show all
Defined in:
app/decorators/tramway/event/participant_form_field_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.collectionsObject



5
6
7
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 5

def collections
  [:all]
end

.list_attributesObject



9
10
11
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 9

def list_attributes
  [:event_title]
end

.show_attributesObject



13
14
15
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 13

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

Instance Method Details

#created_atObject



36
37
38
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 36

def created_at
  date_view object.created_at
end

#event_titleObject



24
25
26
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 24

def event_title
  object.event.title
end

#field_typeObject



28
29
30
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 28

def field_type
  enumerize_view object.field_type
end

#stateObject



32
33
34
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 32

def state
  state_machine_view object, :state
end

#titleObject



20
21
22
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 20

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

#updated_atObject



40
41
42
# File 'app/decorators/tramway/event/participant_form_field_decorator.rb', line 40

def updated_at
  date_view object.updated_at
end