timothyandrew/blink

View on GitHub
app/decorators/lesson_plan_decorator.rb

Summary

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

  def sorted_items
    model.items.sort_by { |item| item.start || Time.now }
  end

  def formatted_date
    model.date.strftime("%A | %-d %B %Y")
  end

  def title_date
    model.date.strftime("%-d %B %Y")
  end
end