Can't use except validator condition
Hi!
I'm trying to exclude my validation rules from creation scenario, which name specified in ActiveController::createScenario
Example
public function rules()
{
return [
['name', 'required', 'except' => 'create'],
];
}
As you can see, I have no other rules for 'create' scenario, I'm using the scenario just to exclude validation rule.
But when I call Model::validate() it throws "Unknown scenario" exception.
you could define scenarios yourself to work around this. Model should generate scenarios by also including information from except.
@cebe By the way, maybe it is also a bug: If rule has specified no $on, and no $except, it would not be common for all scenarios
Resolved by commit a4f760e