fix for action_filter
wreis [Sat, 1 Aug 2009 01:16:38 +0000 (01:16 +0000)]
lib/Reaction/UI/ViewPort/Role/Actions.pm

index ebd2d3c..32c7bbb 100644 (file)
@@ -33,14 +33,21 @@ has computed_action_order => (
   lazy_build => 1
 );
 
+sub _filter_action_list {
+    my $self = shift;
+    my $actions = [keys %{$self->action_prototypes}];
+    return $self->has_action_filter ?
+        $self->action_filter->($actions, $self->model)
+        : $actions;
+}
+
 sub _build_computed_action_order {
   my $self = shift;
   my $ordered = $self->sort_by_spec(
     ($self->has_action_order ? $self->action_order : []),
-    [ keys %{ $self->action_prototypes } ]
+    $self->_filter_action_list
   );
-  return $self->has_action_filter ?
-      $self->action_filter->($ordered, $self->model) : $ordered;
+  return $ordered;
 }
 
 sub _build_actions {