Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ermolaev committed Jul 8, 2024
1 parent 2989726 commit c083d72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class NestedDryForm < Form
required(:price).filled(:integer)
optional(:description).maybe(:string)
optional(:upload_attachments).maybe(:array)
optional(:bookmarks).array(Dry.Types::Instance(BookmarkForm))
optional(:bookmarks).array(Dry.Types.Constructor(BookmarkForm) { |params| BookmarkForm.new(params: params) })
end
end

Expand All @@ -232,7 +232,7 @@ class NestedDryForm < Form
end
```

As you noticed in the above example, we use the construction `Dry.Types::Instance(BookmarkForm)`,
As you noticed in the above example, we use the construction `Dry.Types.Constructor(BookmarkForm) { |params| BookmarkForm.new(params: params) }`,
what it is `dry types` you can find out [here](https://dry-rb.org/gems/dry-types)


Expand Down

0 comments on commit c083d72

Please sign in to comment.