diff options
Diffstat (limited to 'lib/ComponentUI/Controller/TestModel/Bar.pm')
-rw-r--r-- | lib/ComponentUI/Controller/TestModel/Bar.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/ComponentUI/Controller/TestModel/Bar.pm b/lib/ComponentUI/Controller/TestModel/Bar.pm index 4701fff..6c1118c 100644 --- a/lib/ComponentUI/Controller/TestModel/Bar.pm +++ b/lib/ComponentUI/Controller/TestModel/Bar.pm @@ -1,7 +1,7 @@ package ComponentUI::Controller::TestModel::Bar; -use base 'Reaction::UI::Controller::Collection::CRUD'; -use Reaction::Class; +use Moose; +BEGIN { extends 'Reaction::UI::Controller::Collection::CRUD'; } __PACKAGE__->config( model_name => 'TestModel', @@ -16,17 +16,22 @@ __PACKAGE__->config( layout => 'bar/collection', member_class => 'Reaction::UI::ViewPort::Object', Member => { layout => 'bar/member' } - } - } + }, + }, }, ); -sub get_collection { - my ($self, $c) = @_; - my $collection = $self->next::method($c); +around get_collection => sub { + my ($orig, $self, $c) = @_; + my $collection = $self->$orig($c); return $collection->where({}, { prefetch => 'foo' }); -} +}; + +1; + +__END__; +#put this aside for now sub create :Chained('base') { my $self = shift; my ($c) = @_; |