Skip to content

Update inspect method to handle nil serializable_hash#384

Merged
dblock merged 8 commits into
ruby-grape:masterfrom
fcce:ce/serializable_hash_nil
May 24, 2025
Merged

Update inspect method to handle nil serializable_hash#384
dblock merged 8 commits into
ruby-grape:masterfrom
fcce:ce/serializable_hash_nil

Conversation

@fcce

@fcce fcce commented Apr 28, 2024

Copy link
Copy Markdown
Contributor

serializable_hash may return nil

before

Entities::User.represent nil
# An error occurred when inspecting the object: #<NoMethodError: undefined method `map' for nil:NilClass>

after

Entities::User.represent nil
#<Entities::User:326200 nil>

@dblock dblock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test and update CHANGELOG please?

@fcce fcce force-pushed the ce/serializable_hash_nil branch from 5be9bba to a68b90d Compare May 6, 2024 06:56
@fcce fcce requested a review from dblock May 6, 2024 07:56
@dblock

dblock commented May 18, 2025

Copy link
Copy Markdown
Member

@numbata or @fcce want to finish this one?

Comment thread lib/grape_entity/entity.rb Outdated
@bogdan bogdan mentioned this pull request May 23, 2025
@dblock dblock merged commit 489f9b9 into ruby-grape:master May 24, 2025
6 checks passed
@dblock

dblock commented May 24, 2025

Copy link
Copy Markdown
Member

Merged this, thanks for your help @numbata!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants