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