mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Move if object to the top
This commit is contained in:
parent
0917148617
commit
baa690a01a
@ -158,13 +158,15 @@ module ActiveModel
|
||||
def serialize
|
||||
object = associated_object
|
||||
|
||||
if object && polymorphic?
|
||||
{
|
||||
:type => polymorphic_key,
|
||||
polymorphic_key => find_serializable(object).serializable_hash
|
||||
}
|
||||
elsif object
|
||||
find_serializable(object).serializable_hash
|
||||
if object
|
||||
if polymorphic?
|
||||
{
|
||||
:type => polymorphic_key,
|
||||
polymorphic_key => find_serializable(object).serializable_hash
|
||||
}
|
||||
else
|
||||
find_serializable(object).serializable_hash
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user