2019-05-02 16:22:16 +02:00
|
|
|
class OperationAuthorSerializer < ActiveModel::Serializer
|
|
|
|
attributes :id, :email
|
|
|
|
|
|
|
|
def id
|
|
|
|
case object
|
|
|
|
when User
|
|
|
|
"Usager##{object.id}"
|
2019-08-06 11:02:54 +02:00
|
|
|
when Instructeur
|
2019-05-02 16:22:16 +02:00
|
|
|
"Instructeur##{object.id}"
|
|
|
|
when Administrateur
|
|
|
|
"Administrateur##{object.id}"
|
|
|
|
when Administration
|
|
|
|
"Manager##{object.id}"
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|