--- /dev/null
+package Reaction::InterfaceModel::Action::DBIC::Result;
+
+use Reaction::InterfaceModel::Action;
+use Reaction::Types::DBIC 'Row';
+use Reaction::Class;
+
+class Result is 'Reaction::InterfaceModel::Action', which {
+
+ has '+target_model' => (isa => Row);
+
+};
+
+1;
package Reaction::InterfaceModel::Action::DBIC::Result::Delete;
+use aliased 'Reaction::InterfaceModel::Action::DBIC::Result';
+use aliased 'Reaction::InterfaceModel::Action::Role::SimpleMethodCall';
use Reaction::Types::DBIC 'Row';
use Reaction::Class;
-class Delete is 'Reaction::InterfaceModel::Action', which {
- has '+target_model' => (isa => Row);
+class Delete is Result, which {
+
+ does SimpleMethodCall;
- sub can_apply { 1 }
-
- implements do_apply => as {
- my $self = shift;
- return $self->target_model->delete;
- };
+ implements _target_model_method => as { 'delete' };
};
package Reaction::InterfaceModel::Action::DBIC::Result::Update;
-use Reaction::InterfaceModel::Action;
+use aliased 'Reaction::InterfaceModel::Action::DBIC::Result';
use Reaction::Types::DBIC 'Row';
use Reaction::Class;
-class Update is 'Reaction::InterfaceModel::Action', which {
+class Update is Result, which {
does 'Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques';
- has '+target_model' => (isa => Row);
-
implements BUILD => as {
my ($self) = @_;
my $tm = $self->target_model;
--- /dev/null
+package Reaction::InterfaceModel::Action::Role::SimpleMethodCall;
+
+use Reaction::Role;
+
+requires '_target_model_method';
+
+sub can_apply { 1; }
+
+sub do_apply {
+ my ($self) = @_;
+ $self->target_model->${\$self->_target_model_method};
+}
+
+1;