X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FBasicCRUD.pod;h=ac5261dfbdd4d00f118c9607312dcb369285c241;hp=598f3e2dc8fe30fbc291134bf700d3c3e427c7b9;hb=c16b23ababd7cc92688183b0c72480966a7876b4;hpb=1cde0fd603f0f21f0197632bd19904f468f28c83 diff --git a/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod b/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod index 598f3e2..ac5261d 100644 --- a/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod +++ b/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod @@ -932,7 +932,7 @@ to use the "query param" technique shown here in your applications. In this section we will explore some additional capabilities offered by DBIx::Class. Although these features have relatively little to do -with Catalyst per-se, you will almost certainly want to take advantage +with Catalyst per se, you will almost certainly want to take advantage of them in your applications. @@ -952,7 +952,7 @@ C. If you are following along in Ubuntu 8.10, you will need to upgrade your version of L -to 0.22 or higher. To do this, we can install directly from CPAN: +to 0.23 or higher. To do this, we can install directly from CPAN: $ cpan Catalyst::Model::DBIC::Schema @@ -960,11 +960,11 @@ Then make sure you are running an appropriate version: $ perl -MCatalyst::Model::DBIC::Schema -e \ 'print "$Catalyst::Model::DBIC::Schema::VERSION\n"' - 0.22 + 0.23 Make sure you get version 0.22 or higher. -B Utuntu will automatically "do the right thing" and use the +B Ubuntu will automatically "do the right thing" and use the module we installed from CPAN and ignore the older version we picked up via the C command. If you are using a different environment, you will need to make sure you are using v0.22 or higher @@ -1132,7 +1132,7 @@ incorporate the datetime logic: =head2 Create a ResultSet Class -An often overlooked but extremly powerful features of DBIC is that it +An often overlooked but extremely powerful features of DBIC is that it allows you to supply your own subclasses of C. It allows you to pull complex and unsightly "query code" out of your controllers and encapsulate it in a method of your ResultSet Class. @@ -1161,14 +1161,14 @@ Then open C and enter the following: =cut sub created_after { - my ($self, $datetime) = @_; - - my $date_str = $self->_source_handle->schema->storage - ->datetime_parser->format_datetime($datetime); - - return $self->search({ - created => { '>' => $date_str } - }); + my ($self, $datetime) = @_; + + my $date_str = $self->_source_handle->schema->storage + ->datetime_parser->format_datetime($datetime); + + return $self->search({ + created => { '>' => $date_str } + }); } 1; @@ -1289,11 +1289,11 @@ C and add the following method: =cut sub title_like { - my ($self, $title_str) = @_; + my ($self, $title_str) = @_; - return $self->search({ - title => { 'like' => "%$title_str%" } - }); + return $self->search({ + title => { 'like' => "%$title_str%" } + }); } We defined the search string as C<$title_str> to make the method more