diff options
author | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-12-31 01:24:34 +0000 |
---|---|---|
committer | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-12-31 01:24:34 +0000 |
commit | 893bf4f1e774c47122cbc222d35ce1667d35d49f (patch) | |
tree | 923259b3bd55e32337e32405e4161cbabaa06538 /lib/Reaction/UI/Controller/Collection.pm | |
parent | 32a4b1a431ecd8e488062fc73af8ff532a1d1a74 (diff) | |
download | reaction-893bf4f1e774c47122cbc222d35ce1667d35d49f.tar.gz reaction-893bf4f1e774c47122cbc222d35ce1667d35d49f.zip |
allow list, create, and delete_all to act on a user-provided collection stored in the stash, similar to how object works. additionally, change how basic_model_action picks a default target if none is given. the exists() check for stash->{object} is just asking for autovivification-related bugs and the new behavior should be 100% compatible with the added benefit of DTRT if a collection is placed in {collection}. This whole system really needs an overhaul at some point, but I am waiting for catamoose to support roles in controllers so we can do it right.
Diffstat (limited to 'lib/Reaction/UI/Controller/Collection.pm')
-rw-r--r-- | lib/Reaction/UI/Controller/Collection.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Reaction/UI/Controller/Collection.pm b/lib/Reaction/UI/Controller/Collection.pm index 9a834f2..3c815a8 100644 --- a/lib/Reaction/UI/Controller/Collection.pm +++ b/lib/Reaction/UI/Controller/Collection.pm @@ -112,7 +112,8 @@ sub object :Chained('base') :PathPart('id') :CaptureArgs(1) { sub list :Chained('base') :PathPart('') :Args(0) { my ($self, $c) = @_; - $self->basic_page($c, { collection => $self->get_collection($c) }); + my $collection = $c->stash->{collection} || $self->get_collection($c); + $self->basic_page($c, { collection => $collection }); } sub view :Chained('object') :Args(0) { |