Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if an array_like object is an Enumerable #302

Closed
wants to merge 1 commit into from

Conversation

triciatzy
Copy link

Context

When passing an array like ActiveModel::Errors, I'm unable to render blueprint because it does not pass array_like? condition. Both [] and ActiveModel::Errors are Enumerable, I'm proposing to check if array is Enumerable instead.

Let me know what you guys think? Thank you.

Usage Example

Before

ModelBlueprint.render(model.errors.full_messages, root: :errors)

After

ModelBlueprint.render(model.errors, root: :errors)

@ritikesh
Copy link
Collaborator

ritikesh commented May 2, 2023

@triciatzy - we recently fixed this in the fork - blueprinter-ruby#6. Pls let me know if it helps.

@triciatzy
Copy link
Author

Thanks @ritikesh

@triciatzy triciatzy closed this May 3, 2023
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.

2 participants