From 62a18e4d0e05f5d8ef18a7c25456213060e39521 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 18 Feb 2011 10:12:12 -0600 Subject: make sure we're showing the historical view of the right page --- lib/Narwhal/Page.pm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/Narwhal/Page.pm') diff --git a/lib/Narwhal/Page.pm b/lib/Narwhal/Page.pm index 70f2f87..829ce2e 100644 --- a/lib/Narwhal/Page.pm +++ b/lib/Narwhal/Page.pm @@ -5,17 +5,16 @@ use Narwhal::Page::Revision; with 'KiokuDB::Role::ID'; -has id => ( - is => 'ro', - isa => 'Str', - required => 1, -); - has current_revision => ( is => 'rw', isa => 'Narwhal::Page::Revision', required => 1, - handles => ['text', 'author', 'modification_date'], + handles => { + id => 'page_id', + text => 'text', + author => 'author', + modification_date => 'modification_date', + }, ); sub kiokudb_object_id { 'page:' . shift->id } @@ -31,9 +30,8 @@ sub new_page { my $class = shift; my %opts = @_; my $id = delete $opts{id}; - my $rev = Narwhal::Page::Revision->new(%opts); + my $rev = Narwhal::Page::Revision->new(page_id => $id, %opts); return $class->new( - id => $id, current_revision => $rev, ); } -- cgit v1.2.3-54-g00ecf