database_events needs to be an ArrayRef
Justin Hunter [Mon, 27 Sep 2010 21:10:06 +0000 (14:10 -0700)]
lib/SQL/Translator/Object/Trigger.pm

index 2bd60d5..c212be8 100644 (file)
@@ -94,7 +94,8 @@ class SQL::Translator::Object::Trigger extends SQL::Translator::Object {
     around BUILDARGS(ClassName $self: @args) {
         my $args = $self->$orig(@args);
 
-        $args->{_database_events} = delete $args->{database_events} || [];
+        my $database_events = delete $args->{database_events};
+        $args->{_database_events} = ref $database_events ? $database_events : [ $database_events ];
 
         return $args;
      }