[Catalyst-commits] r10108 -
Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial
kiffin at dev.catalyst.perl.org
kiffin at dev.catalyst.perl.org
Wed May 13 12:02:44 GMT 2009
Author: kiffin
Date: 2009-05-13 12:02:43 +0000 (Wed, 13 May 2009)
New Revision: 10108
Modified:
Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authentication.pod
Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authorization.pod
Log:
Finally got the lousy role-i-mean-roles thing figured out. Authorization completed up to but not including the 'ENABLE MODEL-BASED AUTHORIZATION' section.
Modified: Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authentication.pod
===================================================================
--- Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authentication.pod 2009-05-13 09:39:07 UTC (rev 10107)
+++ Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authentication.pod 2009-05-13 12:02:43 UTC (rev 10108)
@@ -167,7 +167,7 @@
# 2) Name of has_many() relationship this many_to_many() is shortcut for
# 3) Name of belongs_to() relationship in model class of has_many() above
# You must already have the has_many() defined to use a many_to_many().
- __PACKAGE__->many_to_many(role => 'map_user_role', 'role');
+ __PACKAGE__->many_to_many(roles => 'map_user_role', 'role');
C<lib/MyApp/Schema/Result/Role.pm>:
Modified: Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authorization.pod
===================================================================
--- Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authorization.pod 2009-05-13 09:39:07 UTC (rev 10107)
+++ Catalyst-Manual/5.70/branches/depluralise/lib/Catalyst/Manual/Tutorial/Authorization.pod 2009-05-13 12:02:43 UTC (rev 10108)
@@ -168,16 +168,16 @@
if ($c->check_user_roles('admin')) {
# Call create() on the book model object. Pass the table
# columns/field values we want to set as hash values
- my $book = $c->model('DB::Books')->create({
+ my $book = $c->model('DB::Book')->create({
title => $title,
rating => $rating
});
# Add a record to the join table for this book, mapping to
# appropriate author
- $book->add_to_book_authors({author_id => $author_id});
+ $book->add_to_book_author({author_id => $author_id});
# Note: Above is a shortcut for this:
- # $book->create_related('book_authors', {author_id => $author_id});
+ # $book->create_related('book_author', {author_id => $author_id});
# Assign the Book object to the stash for display in the view
$c->stash->{book} = $book;
More information about the Catalyst-commits
mailing list