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.12.7 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.6.4 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.6.3 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.6.2 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.6 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.5 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.4 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.10 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.9 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.8 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.7 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.6 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.5 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.4 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.3 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.2 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3.1 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.3 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.2 app/decorators/tramway/event/partaking_decorator.rb
tramway-event-1.12.1.1 app/decorators/tramway/event/partaking_decorator.rb