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=9e498d9149a565398c4a2c71705c3a11cbfb148b;p=scpubgit%2Fstemmatology.git making tradition user become a weak ref --- diff --git a/lib/Text/Tradition.pm b/lib/Text/Tradition.pm index e135da9..923ef16 100644 --- a/lib/Text/Tradition.pm +++ b/lib/Text/Tradition.pm @@ -61,6 +61,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); } {