[Bast-commits] r7779 - in DBIx-Class/0.08/trunk: . lib/DBIx/Class
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sun Oct 11 13:44:18 GMT 2009
Author: ribasushi
Date: 2009-10-11 13:44:18 +0000 (Sun, 11 Oct 2009)
New Revision: 7779
Modified:
DBIx-Class/0.08/trunk/Changes
DBIx-Class/0.08/trunk/lib/DBIx/Class/Ordered.pm
Log:
More ordered fixes
Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes 2009-10-10 16:49:15 UTC (rev 7778)
+++ DBIx-Class/0.08/trunk/Changes 2009-10-11 13:44:18 UTC (rev 7779)
@@ -6,6 +6,7 @@
(RT #50209)
- Fixed on_connect_do/call regression when used with a coderef
connector (RT #50003)
+ - A couple of fixes to Ordered to remedy subclassing issues
0.08112 2009-09-21 10:57:00 (UTC)
- Remove the recommends from Makefile.PL, DBIx::Class is not
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Ordered.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Ordered.pm 2009-10-10 16:49:15 UTC (rev 7778)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Ordered.pm 2009-10-11 13:44:18 UTC (rev 7779)
@@ -682,27 +682,9 @@
if you are working with preexisting non-normalised position data,
or if you need to work with materialized path columns.
-=head2 _position
-
- my $num_pos = $item->_position;
-
-Returns the B<absolute numeric position> of the current object, with the
-first object being at position 1, its sibling at position 2 and so on.
-By default simply returns the value of L</position_column>.
-
-=cut
-sub _position {
- my $self = shift;
-
-# #the right way to do this
-# return $self->previous_siblings->count + 1;
-
- return $self->get_column ($self->position_column);
-}
-
=head2 _position_from_value
- my $num_pos = $item->_position_of_value ( $pos_value )
+ my $num_pos = $item->_position_from_value ( $pos_value )
Returns the B<absolute numeric position> of an object with a B<position
value> set to C<$pos_value>. By default simply returns C<$pos_value>.
@@ -864,6 +846,19 @@
);
}
+=head2 _position
+
+ my $num_pos = $item->_position;
+
+Returns the B<absolute numeric position> of the current object, with the
+first object being at position 1, its sibling at position 2 and so on.
+
+=cut
+sub _position {
+ my $self = shift;
+ return $self->_position_from_value ($self->get_column ($self->position_column) );
+}
+
=head2 _grouping_clause
This method returns one or more name=>value pairs for limiting a search
More information about the Bast-commits
mailing list