From: Arthur Axel 'fREW' Schmidt Date: Tue, 10 Jul 2012 18:46:46 +0000 (-0500) Subject: fixup! Add flag for correctly introspecting fk rels X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7fc30cfd82d263d3a58dc2ddb375842fbca837d3;p=dbsrgits%2FDBIx-Class.git fixup! Add flag for correctly introspecting fk rels pretty sure riba wanted me to remove the exists check, can't find log of that though --- diff --git a/lib/DBIx/Class/Relationship/BelongsTo.pm b/lib/DBIx/Class/Relationship/BelongsTo.pm index aeb434b..d56a89f 100644 --- a/lib/DBIx/Class/Relationship/BelongsTo.pm +++ b/lib/DBIx/Class/Relationship/BelongsTo.pm @@ -19,7 +19,7 @@ sub belongs_to { # assume a foreign key contraint unless defined otherwise $attrs->{is_foreign_key_constraint} = 1 - if not exists $attrs->{is_foreign_key_constraint}; + if not $attrs->{is_foreign_key_constraint}; $attrs->{is_foreign_rel} = 1 if not exists $attrs->{is_foreign_rel}; diff --git a/lib/DBIx/Class/Relationship/HasMany.pm b/lib/DBIx/Class/Relationship/HasMany.pm index 06a3bc3..47822ea 100644 --- a/lib/DBIx/Class/Relationship/HasMany.pm +++ b/lib/DBIx/Class/Relationship/HasMany.pm @@ -52,7 +52,7 @@ sub has_many { my $default_cascade = ref $cond eq 'CODE' ? 0 : 1; $attrs->{is_foreign_rel} = 0 - if not exists $attrs->{is_foreign_rel}; + if not $attrs->{is_foreign_rel}; $class->add_relationship($rel, $f_class, $cond, { accessor => 'multi', diff --git a/lib/DBIx/Class/Relationship/HasOne.pm b/lib/DBIx/Class/Relationship/HasOne.pm index b0d21aa..212b54b 100644 --- a/lib/DBIx/Class/Relationship/HasOne.pm +++ b/lib/DBIx/Class/Relationship/HasOne.pm @@ -54,7 +54,7 @@ sub _has_one { my $default_cascade = ref $cond eq 'CODE' ? 0 : 1; $attrs->{is_foreign_rel} = 0 - if not exists $attrs->{is_foreign_rel}; + if not $attrs->{is_foreign_rel}; $class->add_relationship($rel, $f_class, $cond,