aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-05-07 17:37:50 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-05-07 17:37:50 +0000
commit6f39e2d485713321d06bf67088315414cefe2090 (patch)
tree74d2361f62c5e7bdacdf873bdc16a90d5f6308b1
parent504e2c4437db6f0962d28334a7e2db036a1deaad (diff)
downloadreaction-6f39e2d485713321d06bf67088315414cefe2090.tar.gz
reaction-6f39e2d485713321d06bf67088315414cefe2090.zip
no reason for member_type to build lazily, it should be required
-rw-r--r--lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm11
-rw-r--r--lib/Reaction/UI/ViewPort/Collection.pm2
-rw-r--r--lib/Reaction/UI/ViewPort/Collection/Grid.pm2
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm b/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm
index b2a0685..7b82176 100644
--- a/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm
+++ b/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm
@@ -14,7 +14,14 @@ role Base, which {
isa => 'DBIx::Class::ResultSet',
);
- has 'member_type' => (is => 'ro', isa => 'ClassName', lazy_build => 1);
+ has 'member_type' => (
+ is => 'rw',
+ isa => 'ClassName',
+ required => 1,
+ builder => '_build_member_type',
+ clearer => 'clear_member_type',
+ predicate => 'has_member_type',
+ );
#implements BUILD => as {
@@ -43,7 +50,7 @@ role Base, which {
implements clone => as {
my $self = shift;
- my $rs = $self->_source_resultset->search_rs({});
+ my $rs = $self->_source_resultset; #->search_rs({});
#should the clone include the arrayref of IM::Objects too?
return (blessed $self)->new(
_source_resultset => $rs,
diff --git a/lib/Reaction/UI/ViewPort/Collection.pm b/lib/Reaction/UI/ViewPort/Collection.pm
index 35701c5..26b75d4 100644
--- a/lib/Reaction/UI/ViewPort/Collection.pm
+++ b/lib/Reaction/UI/ViewPort/Collection.pm
@@ -31,7 +31,7 @@ class Collection is 'Reaction::UI::ViewPort', which {
};
implements _build_current_collection => as {
- shift->collection;
+ return $_[0]->collection;
};
#I'm not really sure why this is here all of a sudden.
diff --git a/lib/Reaction/UI/ViewPort/Collection/Grid.pm b/lib/Reaction/UI/ViewPort/Collection/Grid.pm
index 916df3d..3719aa7 100644
--- a/lib/Reaction/UI/ViewPort/Collection/Grid.pm
+++ b/lib/Reaction/UI/ViewPort/Collection/Grid.pm
@@ -30,8 +30,6 @@ class Grid is 'Reaction::UI::ViewPort::Collection', which {
implements _build_computed_field_order => as {
my ($self) = @_;
- confess("current_collection lacks a value for 'member_type' attribute")
- unless $self->current_collection->has_member_type;
my %excluded = map { $_ => undef } @{ $self->excluded_fields };
#treat _$field_name as private and exclude fields with no reader
my @names = grep { $_ !~ /^_/ && !exists($excluded{$_})} map { $_->name }