Support JSON serialization options for model objects (#811)
This commit is contained in:
1 parent
05a1367af1
commit
75606c6ca6
2 files changed
+13
-1
No files matched your search
@@ -145,7 +145,7 @@ module Google
|
||||
|
||||
def to_json(*a)
|
||||
representation = self.class.const_get(:Representation)
|
||||
representation.new(self).to_json(user_options: { skip_undefined: true })
|
||||
representation.new(self).to_hash(user_options: { skip_undefined: true }).to_json(*a)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user