mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Add symbol support for ActiveModel::Serializer.type method
The ActiveModel::Serializer.type method now accepts symbol as paremeter: class AuthorSerializer < ActiveModel::Serializer type :profile end The test file for the type was also refactored.
This commit is contained in:
committed by
Yohan Robert
parent
f02f0849b1
commit
727d7631ae
@@ -17,7 +17,7 @@ module ActiveModel
|
||||
# class AdminAuthorSerializer < ActiveModel::Serializer
|
||||
# type 'authors'
|
||||
def type(type)
|
||||
self._type = type
|
||||
self._type = type && type.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user