Skip to content

Accessing the context from the promises? #36

@zedtux

Description

@zedtux

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions