Fix unpredictable use of reverse_relationship_info() in the SQLT parser
authorPeter Rabbitson <ribasushi@cpan.org>
Sat, 27 Aug 2016 08:31:01 +0000 (10:31 +0200)
committerPeter Rabbitson <ribasushi@cpan.org>
Mon, 19 Sep 2016 12:28:05 +0000 (14:28 +0200)
commita4e4185f3c1e0af23dc3d916f706d0e92f95de45
tree0d0e30cb8027e8d72a6f6c541ef76a2bdd79b9af
parentc6ec79000b160e7491d9ab9d95d6e69c473b0862
Fix unpredictable use of reverse_relationship_info() in the SQLT parser

When reverse_relationship_info got introduced in de60a93d, it was inexplicably
mis-applied at the very spot it was needed in the first place. A result class
pair can (and sometimes do) have more than one relationship between them,
possibly with differing cascade_* settings. Grabbing the first set of values
from the multi-member hash is inconsistent at best.

Fix so that if at least one "hard-dependency" is encountered we go ahead with
marking the reverse part as a CASCADE
Changes
lib/SQL/Translator/Parser/DBIx/Class.pm
t/lib/DBICTest/Schema/SelfRef.pm