aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ComponentUI
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-09-11 13:36:16 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-09-11 13:36:16 +0000
commit931cbc8d6673ec352b369ae2f70f01ff96b4f507 (patch)
tree76bc70e74d79bc67dd2f65dd5c96874c0f266db4 /lib/ComponentUI
parent4cfd76298443492e3396cb6bfd5e0990fcf5eab5 (diff)
downloadreaction-931cbc8d6673ec352b369ae2f70f01ff96b4f507.tar.gz
reaction-931cbc8d6673ec352b369ae2f70f01ff96b4f507.zip
initial refactor of CRUD controller actions as roles
Diffstat (limited to 'lib/ComponentUI')
-rw-r--r--lib/ComponentUI/Controller/TestModel/Bar.pm17
-rw-r--r--lib/ComponentUI/Controller/TestModel/Foo.pm12
2 files changed, 17 insertions, 12 deletions
diff --git a/lib/ComponentUI/Controller/TestModel/Bar.pm b/lib/ComponentUI/Controller/TestModel/Bar.pm
index 4701fff..7ede58e 100644
--- a/lib/ComponentUI/Controller/TestModel/Bar.pm
+++ b/lib/ComponentUI/Controller/TestModel/Bar.pm
@@ -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) = @_;
diff --git a/lib/ComponentUI/Controller/TestModel/Foo.pm b/lib/ComponentUI/Controller/TestModel/Foo.pm
index 917ea17..2fb994c 100644
--- a/lib/ComponentUI/Controller/TestModel/Foo.pm
+++ b/lib/ComponentUI/Controller/TestModel/Foo.pm
@@ -49,11 +49,11 @@ for my $action (qw/view create update/){
);
}
-sub _build_action_viewport_args {
- my $self = shift;
- my $args = $self->next::method(@_);
- $args->{list}{action_prototypes}{delete_all}{label} = 'Delete All Records';
- return $args;
-}
+# sub _build_action_viewport_args {
+# my $self = shift;
+# my $args = $self->next::method(@_);
+# # $args->{list}{action_prototypes}{delete_all}{label} = 'Delete All Records';
+# return $args;
+# }
1;