Skip to content

Validations are passed options #9

@pboling

Description

@pboling

Documentation says this should work:

string :style, default: "flat", validator: ->(v) {
  raise "style can't be empty" if v.empty?
}

But I'm getting an error with that construction:

     ArgumentError:
       wrong number of arguments (given 2, expected 1)

Instead what works is this:

string :style, default: "flat", validator: ->(v, _options) {
  raise "style can't be empty" if v.empty?
}

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