use Carp::Clan '^SQL::Translator';
use List::Util 'max';
+use Sub::Quote qw(quote_sub);
extends 'SQL::Translator::Schema::Object';
has _constraints => (
is => 'ro',
init_arg => undef,
- default => sub { +[] },
+ default => quote_sub(q{ +[] }),
predicate => 1,
lazy => 1,
);
has _indices => (
is => 'ro',
init_arg => undef,
- default => sub { [] },
+ default => quote_sub(q{ [] }),
predicate => 1,
lazy => 1,
);
has _fields => (
is => 'ro',
init_arg => undef,
- default => sub { +{} },
+ default => quote_sub(q{ +{} }),
predicate => 1,
lazy => 1
);
has comments => (
is => 'rw',
coerce => sub { ref($_[0]) eq 'ARRAY' ? $_[0] : [$_[0]] },
- default => sub { [] },
+ default => quote_sub(q{ [] }),
);
around comments => sub {
=cut
-has _can_link => ( is => 'ro', init_arg => undef, default => sub { +{} } );
+has _can_link => ( is => 'ro', init_arg => undef, default => quote_sub(q{ +{} }) );
sub can_link {
my ( $self, $table1, $table2 ) = @_;
=cut
-has order => ( is => 'rw', default => sub { 0 } );
+has order => ( is => 'rw', default => quote_sub(q{ 0 }) );
around order => sub {
my ( $orig, $self, $arg ) = @_;