aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-06-14 03:12:43 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-06-14 03:12:43 +0000
commitdcd5fef705e78ae7c8ca1c7be9874486aa595fbb (patch)
treef79c9454e33f69d0ae9d23400e7a3d1e9f0b68dd
parentdf9a9c12d191bc0a4fa397f14134784850f8a827 (diff)
downloadreaction-dcd5fef705e78ae7c8ca1c7be9874486aa595fbb.tar.gz
reaction-dcd5fef705e78ae7c8ca1c7be9874486aa595fbb.zip
*grumble*inheritable classdata *grumble*
-rw-r--r--lib/DBIx/Class/IntrospectableM2M.pm10
-rw-r--r--lib/Reaction/InterfaceModel/Reflector/DBIC.pm20
2 files changed, 8 insertions, 22 deletions
diff --git a/lib/DBIx/Class/IntrospectableM2M.pm b/lib/DBIx/Class/IntrospectableM2M.pm
index 7e8146c..e3a921e 100644
--- a/lib/DBIx/Class/IntrospectableM2M.pm
+++ b/lib/DBIx/Class/IntrospectableM2M.pm
@@ -10,10 +10,13 @@ __PACKAGE__->mk_classdata( _m2m_metadata => {} );
sub many_to_many {
my $class = shift;
my ($meth_name, $link, $far_side) = @_;
+ my $store = $class->_m2m_metadata;
+ die("You are overwritting another relationship's metadata")
+ if exists $store->{$meth_name};
- $class->_m2m_metadata->{$meth_name} =
+ my $attrs =
{
- accessor => $meth_name,
+ accessor => $meth_name,
relation => $link, #"link" table or imediate relation
foreign_relation => $far_side, #'far' table or foreign relation
(@_ > 3 ? (attrs => $_[3]) : ()), #only store if exist
@@ -23,6 +26,9 @@ sub many_to_many {
remove_method => "remove_from_${meth_name}",
};
+ #inheritable data workaround/
+ $class->_m2m_metadata({ $meth_name => $attrs, %$store});
+
$class->next::method(@_);
}
diff --git a/lib/Reaction/InterfaceModel/Reflector/DBIC.pm b/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
index 5c852b6..ddd8899 100644
--- a/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
+++ b/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
@@ -340,26 +340,6 @@ class DBIC, which {
},
);
-# my %debug_attr_opts =
-# (
-# lazy => 1,
-# required => 1,
-# isa => $collection,
-# reader => $reader,
-# predicate => "has_" . $self->_class_to_attribute_name($name) ,
-# domain_model => $dm_name,
-# orig_attr_name => $source,
-# default => qq^sub {
-# my \$self = \$_[0];
-# return $collection->new(
-# _source_resultset => \$self->$dm_name->resultset("$source"),
-# _parent => \$self,
-# );
-# }, ^,
-# );
-
-
-
my $make_immutable = $meta->is_immutable;
$meta->make_mutable if $make_immutable;
my $attr = $meta->add_attribute($name, %attr_opts);