[Catalyst-commits] r14524 - CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Mon May 12 19:46:06 GMT 2014
Author: karpet
Date: 2014-05-12 19:46:06 +0000 (Mon, 12 May 2014)
New Revision: 14524
Modified:
CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm
Log:
zap TODO, instead allowing model to indicate support
Modified: CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm 2014-05-12 19:42:59 UTC (rev 14523)
+++ CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm 2014-05-12 19:46:06 UTC (rev 14524)
@@ -343,7 +343,13 @@
return;
}
- $self->throw_error('TODO');
+ if ( !$self->model_can( $c, 'create_related' ) ) {
+ $self->status_bad_request( $c,
+ message =>
+ 'This server does not yet implement the required method create_related'
+ );
+ return;
+ }
my $rel_obj
= $self->do_model( $c, 'create_related', $c->stash->{object}, $rel, );
@@ -359,7 +365,7 @@
else {
# TODO msg
- $self->status_bad_request( $c, message => 'Failed to delete' );
+ $self->status_bad_request( $c, message => 'Failed to create' );
}
}
More information about the Catalyst-commits
mailing list