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

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

Open
beporter opened this issue Nov 3, 2015 · 0 comments
Open

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

beporter opened this issue Nov 3, 2015 · 0 comments
Labels

Comments

@beporter
Copy link
Contributor

beporter commented Nov 3, 2015

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.

@beporter beporter added the bug label Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant