« lib/Reaction/UI/Controller/Collection/CRUD/Search.pm
↑ Summary
lib/ComponentUI/Controller/TestModel/Foo.pm »
| 1 | package ComponentUI::Controller::TestModel::Bar; | ||
| 2 | |||
| 3 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | BEGIN { extends 'Reaction::UI::Controller::Collection::CRUD'; } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 3 | __PACKAGE__->config( | |
| 7 | model_name => 'TestModel', | ||
| 8 | collection_name => 'Bar', | ||
| 9 | action => { | ||
| 10 | base => { Chained => '/base', PathPart => 'testmodel/bar' }, | ||
| 11 | create => { ViewPort => { layout => 'bar/create' } }, | ||
| 12 | list => { | ||
| 13 | ViewPort => { | ||
| 14 | enable_order_by => [qw/name foo published_at/], | ||
| 15 | coerce_order_by => { foo => ['foo.last_name', 'foo.first_name'] }, | ||
| 16 | layout => 'bar/collection', | ||
| 17 | member_class => 'Reaction::UI::ViewPort::Object', | ||
| 18 | Member => { layout => 'bar/member' } | ||
| 19 | }, | ||
| 20 | }, | ||
| 21 | }, | ||
| 22 | ); | ||
| 23 | |||
| 24 | 0 | ▶ | around get_collection => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 25 | 0 | my ($orig, $self, $c) = @_; | |
| 26 | 0 | my $collection = $self->$orig($c); | |
| 27 | 0 | return $collection->where({}, { prefetch => 'foo' }); | |
| 28 | 3 | }; | |
| 29 | |||
| 30 | 3 | 1; | |
| 31 | |||
| 32 | __END__; | ||