with the new fields:
$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
- create=static components=TimeStamp dbi:SQLite:myapp.db
+ create=static components=TimeStamp dbi:SQLite:myapp.db \
+ on_connect_do="PRAGMA foreign_keys = ON"
exists "/root/dev/MyApp/script/../lib/MyApp/Model"
exists "/root/dev/MyApp/script/../t"
Dumping manual schema for MyApp::Schema to directory /root/dev/MyApp/script/../lib ...
sub created_after {
my ($self, $datetime) = @_;
- my $date_str = $self->_source_handle->schema->storage
+ my $date_str = $self->result_source->schema->storage
->datetime_parser->format_datetime($datetime);
return $self->search({
1;
-Then we need to tell the Result Class to to treat this as a ResultSet
-Class. Open C<lib/MyApp/Schema/Result/Book.pm> and add the following
-above the "C<1;>" at the bottom of the file:
-
- #
- # Set ResultSet Class
- #
- __PACKAGE__->resultset_class('MyApp::Schema::ResultSet::Book');
-
Then add the following method to the C<lib/MyApp/Controller/Books.pm>:
=head2 list_recent