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

Shawn Moore sartak at bestpractical.com
Wed Feb 9 00:14:16 EST 2011


The branch, master has been updated
       via  03a1b758bbf60e8974b3658c388f177713a7684a (commit)
       via  03dba9bebb08684ce5167b81057eb418fef47772 (commit)
       via  a8970ce1933ff22b6880f35c1169dcae23f49797 (commit)
       via  53ce626ed659d1c8212d79a98375cdbd4cce9d61 (commit)
      from  7d39d72b165240483861ad054ec4fc9e4bc6034c (commit)

Summary of changes:
 .../RecordHistory/Mixin/Model/RecordHistory.pm     |   23 ++++++++++++++++++++
 .../Plugin/RecordHistory/Model/TransactionEntry.pm |    2 +-
 t/TestApp-Plugin-RecordHistory/etc/config.yml      |    3 ++
 3 files changed, 27 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 53ce626ed659d1c8212d79a98375cdbd4cce9d61
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 00:05:00 2011 -0500

    Add a 1; to the end of the file

diff --git a/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm b/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
index 83f3e14..6265419 100644
--- a/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
+++ b/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
@@ -18,3 +18,5 @@ sub import {
     });
 }
 
+1;
+

commit a8970ce1933ff22b6880f35c1169dcae23f49797
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 00:13:28 2011 -0500

    refers to -> refers_to

diff --git a/lib/Jifty/Plugin/RecordHistory/Model/TransactionEntry.pm b/lib/Jifty/Plugin/RecordHistory/Model/TransactionEntry.pm
index 8e108da..4712486 100644
--- a/lib/Jifty/Plugin/RecordHistory/Model/TransactionEntry.pm
+++ b/lib/Jifty/Plugin/RecordHistory/Model/TransactionEntry.pm
@@ -5,7 +5,7 @@ use strict;
 use Jifty::DBI::Schema;
 use Jifty::Record schema {
     column transaction =>
-        refers to Jifty::Plugin::RecordHistory::Model::Transaction,
+        refers_to Jifty::Plugin::RecordHistory::Model::Transaction,
         label is 'Transaction',
         is immutable;
 

commit 03dba9bebb08684ce5167b81057eb418fef47772
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 00:13:44 2011 -0500

    Add the plugin to the test config

diff --git a/t/TestApp-Plugin-RecordHistory/etc/config.yml b/t/TestApp-Plugin-RecordHistory/etc/config.yml
index 63be0a5..302a25d 100644
--- a/t/TestApp-Plugin-RecordHistory/etc/config.yml
+++ b/t/TestApp-Plugin-RecordHistory/etc/config.yml
@@ -48,6 +48,9 @@ framework:
     - 
       SkeletonApp: {}
 
+    - 
+      RecordHistory: {}
+
   PubSub: 
     Backend: Memcached
     Enable: ~

commit 03a1b758bbf60e8974b3658c388f177713a7684a
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 00:13:53 2011 -0500

    Export a transactions method from the mixin

diff --git a/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm b/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
index 6265419..61f52f3 100644
--- a/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
+++ b/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
@@ -1,11 +1,16 @@
 package Jifty::Plugin::RecordHistory::Mixin::Model::RecordHistory;
 use strict;
 use warnings;
+use base 'Exporter';
+
+our @EXPORT = qw(transactions);
 
 sub import {
     my $class = shift;
     my $caller = caller;
 
+    $class->export_to_level(1, @_);
+
     $caller->add_trigger(after_set => sub {
         my $record = shift;
         my %args   = (
@@ -18,5 +23,21 @@ sub import {
     });
 }
 
+sub transactions {
+    my $self = shift;
+    my $transactions = Jifty::Plugin::RecordHistory::Model::TransactionCollection->new;
+    $transactions->limit(
+        column => 'record_class',
+        value  => ref($self),
+    );
+
+    $transactions->limit(
+        column => 'record_id',
+        value  => $self->id,
+    );
+
+    return $transactions;
+}
+
 1;
 

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



More information about the Bps-public-commit mailing list