[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. d3539cc61c05c18c0a01eae9951538a036f83d9c

Shawn Moore sartak at bestpractical.com
Wed Feb 9 17:24:16 EST 2011


The branch, master has been updated
       via  d3539cc61c05c18c0a01eae9951538a036f83d9c (commit)
      from  4db3bb7138d2c07b8d3ac5f64514b55a784c4117 (commit)

Summary of changes:
 lib/Jifty/Plugin/RecordHistory/Model/Change.pm |    2 +-
 t/TestApp-Plugin-RecordHistory/t/001-basic.t   |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit d3539cc61c05c18c0a01eae9951538a036f83d9c
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 17:24:04 2011 -0500

    Make sure change->record works... and make it work

diff --git a/lib/Jifty/Plugin/RecordHistory/Model/Change.pm b/lib/Jifty/Plugin/RecordHistory/Model/Change.pm
index 4d5ec86..f5ce81a 100644
--- a/lib/Jifty/Plugin/RecordHistory/Model/Change.pm
+++ b/lib/Jifty/Plugin/RecordHistory/Model/Change.pm
@@ -47,7 +47,7 @@ sub create {
 
 sub record {
     my $self = shift;
-    my $record = $self->record_class;
+    my $record = $self->record_class->new;
     $record->load($self->record_id);
     return $record;
 }
diff --git a/t/TestApp-Plugin-RecordHistory/t/001-basic.t b/t/TestApp-Plugin-RecordHistory/t/001-basic.t
index e7321d0..173e9d6 100644
--- a/t/TestApp-Plugin-RecordHistory/t/001-basic.t
+++ b/t/TestApp-Plugin-RecordHistory/t/001-basic.t
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use Jifty::Test::Dist tests => 8;
+use Jifty::Test::Dist tests => 9;
 
 my $book = TestApp::Plugin::RecordHistory::Model::Book->new;
 $book->create(
@@ -16,6 +16,7 @@ my $change = $book->changes->first;
 is($change->record_id, $book->id, 'record id');
 is($change->record_class, 'TestApp::Plugin::RecordHistory::Model::Book', 'record class');
 is($change->type, 'create', 'change has type create');
+is($change->record->title, '1984', 'change->record');
 
 isa_ok($change->change_fields, 'Jifty::Plugin::RecordHistory::Model::ChangeFieldCollection', 'change field collection');
 is($change->change_fields->count, 0, 'generate no ChangeFields for create');

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list