Closed triciatzy closed 1 year ago
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.
ActiveModel::Errors
array_like?
[]
Enumerable
Let me know what you guys think? Thank you.
ModelBlueprint.render(model.errors.full_messages, root: :errors)
ModelBlueprint.render(model.errors, root: :errors)
@triciatzy - we recently fixed this in the fork - https://github.com/blueprinter-ruby/blueprinter/pull/6. Pls let me know if it helps.
Thanks @ritikesh
Context
When passing an array like
ActiveModel::Errors
, I'm unable to render blueprint because it does not passarray_like?
condition. Both[]
andActiveModel::Errors
areEnumerable
, I'm proposing to check if array isEnumerable
instead.Let me know what you guys think? Thank you.
Usage Example
Before
After