aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/InterfaceModel
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-03-14 17:45:29 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-03-14 17:45:29 +0000
commit9806bd0df982eeb34e7a5d8c473e9e91e0439348 (patch)
tree04683043814618c9cd77f57c7f5335188e26fb50 /lib/Reaction/InterfaceModel
parentba9938e7802f82b445dbdf1c16ce5700feee08b8 (diff)
downloadreaction-9806bd0df982eeb34e7a5d8c473e9e91e0439348.tar.gz
reaction-9806bd0df982eeb34e7a5d8c473e9e91e0439348.zip
$attr_name ne ->reader
Diffstat (limited to 'lib/Reaction/InterfaceModel')
-rw-r--r--lib/Reaction/InterfaceModel/Reflector/DBIC.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Reaction/InterfaceModel/Reflector/DBIC.pm b/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
index 2c34cdf..232a433 100644
--- a/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
+++ b/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
@@ -672,13 +672,14 @@ class DBIC, which {
}
my $from_attr = $source_class->meta->find_attribute_by_name($attr_name);
+ my $reader = $from_attr->get_read_method;
#default options. lazy build but no outsider method
my %attr_opts = ( is => 'ro', lazy => 1, required => 1,
clearer => "_clear_${attr_name}",
predicate => {
"has_${attr_name}" =>
- sub { defined(shift->$dm_name->$attr_name) }
+ sub { defined(shift->$dm_name->$reader) }
},
domain_model => $dm_name,
orig_attr_name => $attr_name,
@@ -689,8 +690,6 @@ class DBIC, which {
$from_attr->type_constraint->name eq 'ArrayRef' ||
$from_attr->type_constraint->is_subtype_of('ArrayRef');
-
-
if( my $rel_info = $source->relationship_info($attr_name) ){
my $rel_accessor = $rel_info->{attrs}->{accessor};
my $rel_moniker = $rel_info->{class}->result_source_instance->source_name;
@@ -745,7 +744,6 @@ class DBIC, which {
#}
} else {
#no rel
- my $reader = $from_attr->get_read_method;
$attr_opts{isa} = $from_attr->_isa_metadata;
$attr_opts{default} = sub{ shift->$dm_name->$reader };
}