Skip to content

Commit

Permalink
add to_s for type and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisst committed Feb 1, 2019
1 parent f2855bf commit 51aa647
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def api_name
end

def to_s
# relies on the custom to_json definitions
JSON.pretty_generate(self)
end

Expand Down
4 changes: 4 additions & 0 deletions api/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def validate
check_conflicts
end

def to_s
JSON.pretty_generate(self)
end

def to_json(opts = nil)
# ignore fields that will contain references to parent resources and
# those which will be added later
Expand Down

0 comments on commit 51aa647

Please sign in to comment.