Skip to content

Instantly share code, notes, and snippets.

@churib
Created May 31, 2013 10:10
Show Gist options
  • Save churib/5684076 to your computer and use it in GitHub Desktop.
Save churib/5684076 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
package Minimum;
use Validation::Class;
directive 'my_directive' => sub { die };
mixin 'my_mixin' => {
my_directive => 1,
};
field 'my_field' => {
mixin => 'my_mixin',
};
__PACKAGE__->new( my_field => 1 )->validate;
@alnewkirk
Copy link

Hey Timo,

Custom directives can only be used as field directives, not as mixin directives, this is by-design but may need to be rethought. field my_field => { my_directive => 1 }; will work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment