class TeachingPeriodSerializer < ActiveModel::Serializer
  attributes :id, :period, :year, :start_date, :end_date, :active_until, :active

  def active
    object.active_until > DateTime.now
  end
end

class TeachingPeriodSerializer < ActiveModel::Serializer
  attributes :id, :period, :year, :start_date, :end_date, :active_until, :active, :units

  def active
    object.active_until > DateTime.now
  end
end

Add units to teaching period serializer
ENHANCE: Add units to teaching period serializer
