Skip to content

Conversation

alex-lairan
Copy link
Contributor

The with option should handle Arrays.

Fix : #7

@alex-lairan alex-lairan force-pushed the feature/support_array_with_option branch from 98976a7 to 6e13771 Compare May 26, 2019 16:38
@alex-lairan alex-lairan force-pushed the feature/support_array_with_option branch from 6e13771 to ea695c2 Compare May 26, 2019 16:49
Copy link
Owner

@c910335 c910335 left a comment

Choose a reason for hiding this comment

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

Sorry for late response.

The documentation of with option (src/crinder.cr L86) should also be fixed.

@@ -47,6 +47,18 @@ class NilableTodoRenderer < TodoRenderer
remove updated
end

record TodoSubtasked, name : String, subtasks : Array(Subtask)
record Subtask, name : String
Copy link
Owner

@c910335 c910335 May 29, 2019

Choose a reason for hiding this comment

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

I prefer moving these two records to L4, under record Todo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think fixtures should be simple and focused to what's important.

@alex-lairan alex-lairan force-pushed the feature/support_array_with_option branch from ea695c2 to 52236d0 Compare May 29, 2019 16:49
@alex-lairan
Copy link
Contributor Author

alex-lairan commented May 29, 2019

Hi !

Thanks for the review.

About this documentation :

# - **with**: a renderer for this field. This field will be filtered by `value` before passing to it. It is not necessary to be a subclass of `Crinder::Base`, but it must have the class method `render(object : T, json : JSON::Builder)` where `T` is the original type of this field.

I need to change render(object : T, json : JSON::Builder) to render(object : T | Array(T), json : JSON::Builder) ?

@c910335
Copy link
Owner

c910335 commented May 29, 2019

@alex-lairan

I need to change render(object : T, json : JSON::Builder) to render(object : T | Array(T), json : JSON::Builder) ?

Yes

@alex-lairan
Copy link
Contributor Author

@c910335 I've finished the documentation :)

@c910335 c910335 merged commit a0d487a into c910335:master May 30, 2019
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.

Using "with" Option to Render an Array
2 participants