Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 48769
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: arthas [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: 0.08110



Subject: Add "date" exampe to synopsis (minor doc impovement)
Attached patch adds a "date" entry to synopsis, to make it clear(er) that date fields should be specified as such, and not as datetime.
Subject: date_synopsis.patch
--- DateTime.pm.trunk +++ DateTime.pm @@ -18,6 +18,7 @@ __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/); __PACKAGE__->add_columns( starts_when => { data_type => 'datetime' } + create_date => { data_type => 'date' } ); NOTE: You B<must> load C<InflateColumn::DateTime> B<before> C<Core>. See
As correctly noted in chat, patch was lacking some documentation. Here's an hopefully improved one.
--- DateTime.pm.trunk +++ DateTime.pm @@ -18,6 +18,7 @@ __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/); __PACKAGE__->add_columns( starts_when => { data_type => 'datetime' } + create_date => { data_type => 'date' } ); NOTE: You B<must> load C<InflateColumn::DateTime> B<before> C<Core>. See @@ -68,6 +69,14 @@ one your code should continue to work without modification (though note that this feature is new as of 0.07, so it may not be perfect yet - bug reports to the list very much welcome). + +If the data_type of a field is date, datetime or timestamp, this module will +automatically call the appropriate parse/format method for inflation/deflation. +For instance, for a datetime field C<parse_datetime> and C<format_datetime> +will be used; for a date field C<parse_date> and C<format_date> will be chosen +instead (if available, otherwise it will fallback to C<*_datetime>). See the +documentation of a C<DateTime::Format> module for more information. + For more help with using components, see L<DBIx::Class::Manual::Component/USING>.
On Thu Aug 20 02:20:03 2009, RIBASUSHI wrote: Show quoted text
Great, there's still a *very* minor thing: a closing parenthesis is lacking after "e.g. C<timestamp with timezone>". :-) Michele.