[Bps-public-commit] App-Changeloggr branch, master, updated. 5d5fd1fd77e9b40625c11ae1f036953ece0303a5

sartak at bestpractical.com sartak at bestpractical.com
Mon Mar 30 15:10:59 EDT 2009


The branch, master has been updated
       via  5d5fd1fd77e9b40625c11ae1f036953ece0303a5 (commit)
      from  2ffc8d7b2c9de4011fdb5216ef09be15a40282dc (commit)

Summary of changes:
 lib/App/Changeloggr/Model/ChangeCollection.pm |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 5d5fd1fd77e9b40625c11ae1f036953ece0303a5
Author: Shawn M Moore <sartak at gmail.com>
Date:   Mon Mar 30 15:10:44 2009 -0400

    Only add the change to the collection if it was actually created

diff --git a/lib/App/Changeloggr/Model/ChangeCollection.pm b/lib/App/Changeloggr/Model/ChangeCollection.pm
index bf09980..cbec04f 100644
--- a/lib/App/Changeloggr/Model/ChangeCollection.pm
+++ b/lib/App/Changeloggr/Model/ChangeCollection.pm
@@ -24,11 +24,18 @@ sub create_from_text {
         last if !defined($newtext);
 
         my $change = App::Changeloggr::Model::Change->new;
-        $change->create(
+
+        my ($ok, $msg) = $change->create(
             %$fields,
             changelog => $changelog,
         );
-        $self->add_record($change);
+
+        if ($ok) {
+            $self->add_record($change);
+        }
+        else {
+            warn "Unable to create Change: $msg";
+        }
 
         $text = $newtext;
     }

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



More information about the Bps-public-commit mailing list