valleyjo/orgman

View on GitHub
app/decorators/attendance_decorator.rb

Summary

Maintainability
A
0 mins
Test Coverage
class AttendanceDecorator < Draper::Decorator
  delegate_all

  def format_excused
    if object.excused == nil
      'pending'
    elsif object.excused
      'accepted'
    else
      'rejected'
    end
  end

  def name_and_date
    object.event.name + " (#{h.format_date(object.event.date)})"
  end
end