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.30 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.29 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.28.4 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.28.3 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.28.2 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.28.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.28 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27.6 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27.5 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27.4 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27.3 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27.2 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.27 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.26 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.25.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.25 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.24.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.24 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.9.23.2 app/decorators/tramway/event/partaking_decorator.rb