Skip to content

Commit

Permalink
Refactor inspect method to use object instead of hash
Browse files Browse the repository at this point in the history
  • Loading branch information
fcce committed Apr 29, 2024
1 parent b7500ec commit 7a44cb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grape_entity/entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ def presented

# Prevent default serialization of :options or :delegator.
def inspect
hash = serializable_hash
if hash.nil?
object = serializable_hash
if object.nil?
"#<#{self.class.name}:#{object_id}> nil"
else
fields = object.map { |k, v| "#{k}=#{v}" }
Expand Down

0 comments on commit 7a44cb5

Please sign in to comment.