```ruby
class TeachingPeriodSerializer < ActiveModel::Serializer
  attributes :id, :period, :year

  def period
    object.period
  end

  def year
    object.year
  end
end
```

Remove the redundant functions from teaching period serializer
user
```ruby
class TeachingPeriodSerializer < ActiveModel::Serializer
  attributes :id, :period, :year, :start_date, :end_date
end
```
assistant