mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Fulfill Object#to_h
This commit is contained in:
parent
f885ee8d7d
commit
ef00242421
@ -139,7 +139,7 @@ module AMS
|
|||||||
@object = object
|
@object = object
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json
|
def to_h
|
||||||
{
|
{
|
||||||
id: id,
|
id: id,
|
||||||
type: type
|
type: type
|
||||||
@ -148,6 +148,7 @@ module AMS
|
|||||||
relationships: relations
|
relationships: relations
|
||||||
}.reject { |_, v| v.empty? })
|
}.reject { |_, v| v.empty? })
|
||||||
end
|
end
|
||||||
|
alias as_json to_h
|
||||||
|
|
||||||
def to_json
|
def to_json
|
||||||
dump(as_json)
|
dump(as_json)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user