From: Peter Rabbitson Date: Wed, 2 Jun 2010 08:39:03 +0000 (+0000) Subject: Make 'default_value' behave like a real accessor X-Git-Tag: v0.11008~44 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=644145cd9dbc55d0207aa4ed26299e58ab34717a;p=dbsrgits%2FSQL-Translator.git Make 'default_value' behave like a real accessor --- diff --git a/Changes b/Changes index 596ac27..6a278ee 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,8 @@ * Fix Producer::Oracle translate float and double to float instead of number * Fix Producer::Oracle generation of too long unique constraint names * Fix Producer::SQLite when generating VIEWs with add_drop_table => 1 +* Fix Field::default_value to behave like a real accessor (allow undef as + an unsetting argument) * Producer::Oracle tests now use Test::Differences * Prettify output of SQLite producer (less bogus newlines) * Augment SQLite and Pg producers to accept a perl-formatted (%d.%03d%03d) diff --git a/lib/SQL/Translator/Schema/Field.pm b/lib/SQL/Translator/Schema/Field.pm index 3249d95..37bb5a6 100644 --- a/lib/SQL/Translator/Schema/Field.pm +++ b/lib/SQL/Translator/Schema/Field.pm @@ -199,8 +199,8 @@ assume an error like other methods. =cut - my ( $self, $arg ) = @_; - $self->{'default_value'} = $arg if defined $arg; + my $self = shift; + $self->{'default_value'} = shift if @_; return $self->{'default_value'}; }