Skip to content

Baked Table::buildRules() rules are too brief. #19

@beporter

Description

@beporter

You get something like this:

$rules->add($rules->isUnique(['email']));

When really we want something like this:

$rules->add(
    $rules->isUnique(['email']),
    'email-is-unique',
    [
        'errorField' => 'email',
        'message' => 'That email address already exists.',
    ]
);

Without those additional properties, the rule will cause a save() to fail, but will not report the error anywhere (not even in DebugKit). This is not an acceptable "default" level of quality. We should have the choice to reduce the "verbosity" of the messages, not be forced to add it by rote. That's the whole point of having bake templates, after all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions