[Bast-commits] r5332 - in trunk/DBIx-Class-TimeStamp: .
lib/DBIx/Class
jshirley at dev.catalyst.perl.org
jshirley at dev.catalyst.perl.org
Wed Jan 21 15:31:06 GMT 2009
Author: jshirley
Date: 2009-01-21 15:31:06 +0000 (Wed, 21 Jan 2009)
New Revision: 5332
Modified:
trunk/DBIx-Class-TimeStamp/Changes
trunk/DBIx-Class-TimeStamp/MANIFEST
trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm
Log:
Removing the checks for timestamp columns, and simply letting the user decide.
Modified: trunk/DBIx-Class-TimeStamp/Changes
===================================================================
--- trunk/DBIx-Class-TimeStamp/Changes 2009-01-21 13:56:49 UTC (rev 5331)
+++ trunk/DBIx-Class-TimeStamp/Changes 2009-01-21 15:31:06 UTC (rev 5332)
@@ -1,8 +1,15 @@
Revision history for DBIx::Class::TimeStamp
-0.05 2008-08-26 05:33:00
+0.07 2009-01-20 07:31:00
+ - Removing the checks for timestamp, and only looking at
+ set_on_(create|update)
+
+0.06 2008-08-26 05:33:00
- Port to DBIx::Class::DynamicDefault (Florian Ragwitz)
+0.05 2007-10-30 00:00:00
+ - Some release
+
0.04 2007-04-27 08:41:00
- Incorporating LTJake's patch to not clobber set values, LTJake++
Modified: trunk/DBIx-Class-TimeStamp/MANIFEST
===================================================================
--- trunk/DBIx-Class-TimeStamp/MANIFEST 2009-01-21 13:56:49 UTC (rev 5331)
+++ trunk/DBIx-Class-TimeStamp/MANIFEST 2009-01-21 15:31:06 UTC (rev 5332)
@@ -1,4 +1,5 @@
Changes
+README
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
@@ -26,4 +27,3 @@
t/lib/DBIC/Test/Schema/TestDate.pm
t/lib/DBIC/Test/Schema/TestDatetime.pm
t/lib/DBIC/Test/Schema/TestTime.pm
-t/sql/test.sqlite.sql
Modified: trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm
===================================================================
--- trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm 2009-01-21 13:56:49 UTC (rev 5331)
+++ trunk/DBIx-Class-TimeStamp/lib/DBIx/Class/TimeStamp.pm 2009-01-21 15:31:06 UTC (rev 5332)
@@ -7,7 +7,7 @@
use DateTime;
-our $VERSION = '0.05';
+our $VERSION = '0.07';
__PACKAGE__->load_components( qw/DynamicDefault InflateColumn::DateTime/ );
@@ -48,13 +48,18 @@
while (my $col = shift @cols) {
my $info = ref $cols[0] ? shift @cols : {};
- if ( $info->{data_type} =~ /^(datetime|date|timestamp)$/i ) {
- if ( delete $info->{set_on_update} ) {
+ if ( delete $info->{set_on_create} ) {
+ $info->{dynamic_default_on_create} = 'get_timestamp';
+ }
+
+ if ( delete $info->{set_on_update} ) {
+ $info->{dynamic_default_on_update} = 'get_timestamp';
+
+ if ( defined $info->{dynamic_default_on_create} and
+ $info->{dynamic_default_on_create} eq 'get_timestamp'
+ ) {
$info->{dynamic_default_on_update} = 'get_timestamp';
}
- if ( delete $info->{set_on_create} ) {
- $info->{dynamic_default_on_create} = 'get_timestamp';
- }
}
push @columns, $col => $info;
@@ -85,12 +90,17 @@
=head1 CONTRIBUTORS
-LTJake
+Florian Ragwitz (Porting to L<DBIx::Class::DynamicDefault>)
-=head1 LICENSE
+LTJake/bricas
-You may distribute this code under the same terms as Perl itself.
+=head1 COPYRIGHT & LICENSE
+Copyright 2009 J. Shirley, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
=cut
1;
More information about the Bast-commits
mailing list