aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--lib/Reaction/InterfaceModel/Action/DBIC/Role/CheckUniques.pm10
2 files changed, 7 insertions, 4 deletions
diff --git a/Changes b/Changes
index b206b1d..fb2e882 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
Revision history for Reaction
0.002000
+ - Update CheckUniques role to use around instead of overrides
- Stop using ACCEPT_CONTEXT, use InstancePerContext instead
- up the dependency version on Devel::Declare to 003004
- Added an error_message attribute to IM::Action
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->(@_);
};