Sha256: b184183525bfcea4783d9994079e0194e0358f58ef97df92d93f4872f23f4b92

Contents?: true

Size: 669 Bytes

Versions: 74

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

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

    def show_attributes
      %i[part_name event_duration part_description]
    end
  end

  decorate_association :part

  def name
    "#{object.person.first_name} #{object.person.last_name} - #{object.position}"
  end

  def part_name
    part.name
  end

  def event_duration
    if part.respond_to? :duration
      part.duration
    else
      part.event.duration
    end
  end

  def part_description
    raw part.respond_to?(:description) ? part.description : part.event.description
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
tramway-event-1.9.23.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.23 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.22 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.21.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.21 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.20.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.20 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.8 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.7 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.6 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.5 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.4 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.3 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.19.2 app/decorators/tramway/event/partaking_decorator.rb