From 0d5a97a87d1e42626f8e21b36ef327afd556865c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 18 Feb 2011 00:43:09 -0600 Subject: don't duplicate user objects --- lib/Narwhal/Component/Wiki/Edit.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Narwhal/Component/Wiki') diff --git a/lib/Narwhal/Component/Wiki/Edit.pm b/lib/Narwhal/Component/Wiki/Edit.pm index 1623d9a..3631e84 100644 --- a/lib/Narwhal/Component/Wiki/Edit.pm +++ b/lib/Narwhal/Component/Wiki/Edit.pm @@ -35,17 +35,20 @@ sub post { $self->txn_do(sub { my $page = $self->lookup("page:$page_name"); + my $user_id = 'foo'; # XXX + my $user = $self->lookup("user:$user_id") + || Narwhal::User->new(id => $user_id); if ($page) { $page->new_revision( text => $req->param('text'), - author => Narwhal::User->new(id => 'foo'), # XXX + author => $user, ); } else { $page = Narwhal::Page->new_page( id => $page_name, text => $req->param('text'), - author => Narwhal::User->new(id => 'foo'), # XXX + author => $user, ); } $self->store($page); -- cgit v1.2.3-54-g00ecf