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

Accessing the context from the promises? #36

Open
zedtux opened this issue Oct 19, 2020 · 0 comments
Open

Accessing the context from the promises? #36

zedtux opened this issue Oct 19, 2020 · 0 comments

Comments

@zedtux
Copy link

zedtux commented Oct 19, 2020

I'd like to ensure my Interator fills in an Array with a size based on an attribute from the context:

promises do
  required(:users).filled(min_size?: context.user_ids.size)
end

But that's not possible since the context is now accessible:

NameError (undefined local variable or method `context' for #<Dry::Schema::DSL:0x0000557f84f3c6a0>):

Would it make sens to add it or am I trying to use this gem in a wrong way?

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

No branches or pull requests

1 participant