From: Eden Cardim Date: Mon, 13 Aug 2012 13:29:15 +0000 (-0300) Subject: making tradition user become a weak ref X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d8a14401c837f6b95b28e8f6b54fb23de031804f;p=scpubgit%2Fstemmatology.git making tradition user become a weak ref --- diff --git a/lib/Text/Tradition.pm b/lib/Text/Tradition.pm index ce64e1d..ca0c5a4 100644 --- a/lib/Text/Tradition.pm +++ b/lib/Text/Tradition.pm @@ -68,6 +68,7 @@ has 'user' => ( required => 0, predicate => 'has_user', clearer => 'clear_user', + weak_ref => 1 ); has 'public' => ( diff --git a/t/text_tradition_user_collapse.t b/t/text_tradition_user_collapse.t index dca99bb..ce8e6bb 100644 --- a/t/text_tradition_user_collapse.t +++ b/t/text_tradition_user_collapse.t @@ -50,6 +50,7 @@ my $email = 'john@doe.com'; my $user = $user_store->find_user( { username => 'fred' } ); $user->email('foo@bar.baz'); $user_store->update($user); + is(scalar @{$user->traditions}, 1); } {