diff options
author | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-01-09 00:24:48 +0000 |
---|---|---|
committer | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-01-09 00:24:48 +0000 |
commit | 538915b92a210c1798cef9cdd700c021a4f8e403 (patch) | |
tree | 4245a6452796c6e99bd76b074e3e79775680532f /lib/Reaction/InterfaceModel | |
parent | eb52e5952c914864f58a122b7587c7383844a790 (diff) | |
download | reaction-538915b92a210c1798cef9cdd700c021a4f8e403.tar.gz reaction-538915b92a210c1798cef9cdd700c021a4f8e403.zip |
fix checkuniques
Diffstat (limited to 'lib/Reaction/InterfaceModel')
-rw-r--r-- | lib/Reaction/InterfaceModel/Action/DBIC/Role/CheckUniques.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Reaction/InterfaceModel/Action/DBIC/Role/CheckUniques.pm b/lib/Reaction/InterfaceModel/Action/DBIC/Role/CheckUniques.pm index 1524f8c..de9b7be 100644 --- a/lib/Reaction/InterfaceModel/Action/DBIC/Role/CheckUniques.pm +++ b/lib/Reaction/InterfaceModel/Action/DBIC/Role/CheckUniques.pm @@ -73,18 +73,20 @@ sub check_all_uniques { after sync_all => sub { shift->check_all_uniques; }; -override error_for_attribute => sub { +around error_for_attribute => sub { + my $orig = shift; my ($self, $attr) = @_; if ($self->_unique_constraint_results->{$attr->name}) { return "Already taken, please try an alternative"; } - return super(); + return $orig->(@_); }; -override can_apply => sub { +around can_apply => sub { + my $orig = shift; my ($self) = @_; return 0 if keys %{$self->_unique_constraint_results}; - return super(); + return $orig->(@_); }; |