little bugfix in regards to collection actions
[catagits/Reaction.git] / lib / Reaction / InterfaceModel / Object.pm
index 7c5ec23..fce4fd2 100644 (file)
@@ -19,7 +19,7 @@ class Object which {
     );
 
   #DBIC::Collection would override this to use result_class for example
-  implements _build_default_action_class_prefix => as {
+  implements _build__default_action_class_prefix => as {
     my $self = shift;
     ref $self || $self;
   };
@@ -36,17 +36,18 @@ class Object which {
 
   implements '_default_action_class_for' => as {
     my ($self, $action) = @_;
-
+    confess("Wrong arguments") unless $action;
     #little trick in case we call it in class context!
     my $prefix = ref $self ?
       $self->_default_action_class_prefix :
-        $self->_build_default_action_class_prefix;
+        $self->_build__default_action_class_prefix;
 
     return join "::", $prefix, 'Action', $action;
   };
 
   implements '_action_class_for' => as {
     my ($self, $action) = @_;
+    confess("Wrong arguments") unless $action;
     if (defined (my $class = $self->_action_class_map->{$action})) {
       return $class;
     }
@@ -55,6 +56,7 @@ class Object which {
 
   implements 'action_for' => as {
     my ($self, $action, %args) = @_;
+    confess("Wrong arguments") unless $action;
     my $class = $self->_action_class_for($action);
     %args = (
       %{$self->_default_action_args_for($action)},