[Jifty-commit] r5873 - in Jifty-DBI/trunk: lib/Jifty/DBI
Jifty commits
jifty-commit at lists.jifty.org
Fri Sep 19 19:01:08 EDT 2008
Author: ruz
Date: Fri Sep 19 19:01:08 2008
New Revision: 5873
Modified:
Jifty-DBI/trunk/ (props changed)
Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm
Log:
r5893 at cubic-pc: cubic | 2008-09-19 22:52:18 +0400
* update record_class' docs
* don't chomp Collection or s if prev character is ':',
die instead, it can happen for annon collections based
either on JDBI::Collection or J::Collection
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm Fri Sep 19 19:01:08 2008
@@ -1013,9 +1013,9 @@
the name of the record class for this collection.
It uses a simple heuristic to determine the record class name -- It
-chops "Collection" off its own name. If you want to name your records
-and collections differently, go right ahead, but don't say we didn't
-warn you.
+chops "Collection" or "s" off its own name. If you want to name your
+records and collections differently, go right ahead, but don't say we
+didn't warn you.
=cut
@@ -1027,7 +1027,7 @@
if ref $self->{record_class};
} elsif ( not ref $self or not $self->{record_class} ) {
my $class = ref($self) || $self;
- $class =~ s/(Collection|s)$//
+ $class =~ s/(?<!:)(Collection|s)$//
|| die "Can't guess record class from $class";
return $class unless ref $self;
$self->{record_class} = $class;
More information about the Jifty-commit
mailing list