diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-18 10:12:12 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-18 11:52:22 -0600 |
commit | 62a18e4d0e05f5d8ef18a7c25456213060e39521 (patch) | |
tree | 3496d4e995888784f13eba628b9d17a11bdfd061 /lib/Narwhal/Page.pm | |
parent | 1ffb8c7688a3ecc947c81bccbd406f277c9d853a (diff) | |
download | narwhal-62a18e4d0e05f5d8ef18a7c25456213060e39521.tar.gz narwhal-62a18e4d0e05f5d8ef18a7c25456213060e39521.zip |
make sure we're showing the historical view of the right page
Diffstat (limited to 'lib/Narwhal/Page.pm')
-rw-r--r-- | lib/Narwhal/Page.pm | 16 |
1 files changed, 7 insertions, 9 deletions
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, ); } |