Use quote_sub for trivial coercions
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator.pm
index 4e299f5..9398b35 100644 (file)
@@ -1,10 +1,8 @@
 package SQL::Translator;
 
-use Moo;
+use Moo 1.000003;
 our ( $DEFAULT_SUB, $DEBUG, $ERROR );
 
-require 5.005;
-
 our $VERSION  = '0.11013';
 $DEBUG    = 0 unless defined $DEBUG;
 $ERROR    = "";
@@ -92,7 +90,7 @@ sub BUILD {
 has $_ => (
     is => 'rw',
     default => quote_sub(q{ 0 }),
-    coerce => sub { $_[0] ? 1 : 0 },
+    coerce => quote_sub(q{ $_[0] ? 1 : 0 }),
 ) foreach qw(add_drop_table no_comments show_warnings trace validate);
 
 # quote_identifiers is on by default, use a 0-but-true as indicator
@@ -100,7 +98,7 @@ has $_ => (
 has quote_identifiers => (
     is => 'rw',
     default => quote_sub(q{ '0E0' }),
-    coerce => sub { $_[0] || 0 },
+    coerce => quote_sub(q{ $_[0] || 0 }),
 );
 
 sub quote_table_names {