appeal_serializer.rb 254 B

123456789101112131415
  1. # frozen_string_literal: true
  2. class REST::AppealSerializer < ActiveModel::Serializer
  3. attributes :text, :state
  4. def state
  5. if object.approved?
  6. 'approved'
  7. elsif object.rejected?
  8. 'rejected'
  9. else
  10. 'pending'
  11. end
  12. end
  13. end