Rename Positioned as Positional.
Aran Deltac [Fri, 24 Mar 2006 15:16:41 +0000 (15:16 +0000)]
lib/DBIx/Class/Manual/Component.pod
lib/DBIx/Class/Positional.pm [moved from lib/DBIx/Class/Positioned.pm with 97% similarity]
lib/DBIx/Class/Tree/AdjacencyList.pm
t/helperrels/26positional.t [moved from t/helperrels/26positioned.t with 76% similarity]
t/lib/DBICTest/Schema.pm
t/lib/DBICTest/Schema/Employee/AdjacencyList.pm
t/lib/DBICTest/Schema/Employee/Positional.pm [moved from t/lib/DBICTest/Schema/Employee/Positioned.pm with 82% similarity]
t/lib/sqlite.sql
t/run/26positional.tl [moved from t/run/26positioned.tl with 95% similarity]

index e7c8a60..1107639 100644 (file)
@@ -68,6 +68,12 @@ L<DBIx::Class::Serialize::Storable> - Hooks for Storable freeze/thaw.
 
 L<DBIx::Class::Validation> - Validate all data before submitting to your database.
 
+L<DBIx::Class::Positional> - Modify the position of objects in an ordered list.
+
+L<DBIx::Class::Tree::AdjacencyList> - Manage a tree of data using the common adjacency list model.
+
+L<DBIx::Class::Tree::NestedSet> - Manage a positional tree of data using the nested set model.
+
 =head2 Core
 
 These are the components that all, or nearly all, people will use 
similarity index 97%
rename from lib/DBIx/Class/Positioned.pm
rename to lib/DBIx/Class/Positional.pm
index 5266f9d..da1fb0a 100644 (file)
@@ -1,12 +1,12 @@
 # vim: ts=8:sw=4:sts=4:et
-package DBIx::Class::Positioned;
+package DBIx::Class::Positional;
 use strict;
 use warnings;
 use base qw( DBIx::Class );
 
 =head1 NAME
 
-DBIx::Class::Positioned - Modify the position of objects in an ordered list.
+DBIx::Class::Positional - Modify the position of objects in an ordered list.
 
 =head1 SYNOPSIS
 
@@ -19,10 +19,10 @@ Create a table for your positionable data.
   );
   # Optional: group_id INTEGER NOT NULL
 
-In your Schema or DB class add Positioned to the top 
+In your Schema or DB class add Positional to the top 
 of the component list.
 
-  __PACKAGE__->load_components(qw( Positioned ... ));
+  __PACKAGE__->load_components(qw( Positional ... ));
 
 Specify the column that stores the position number for 
 each row.
@@ -85,7 +85,7 @@ __PACKAGE__->mk_classdata( 'position_column' => 'position' );
 
 This method specified a column to limit all queries in 
 this module by.  This effectively allows you to have multiple 
-positioned lists within the same table.
+positional lists within the same table.
 
 =cut
 
index c0175d6..57d3958 100644 (file)
@@ -24,7 +24,7 @@ of the component list.
   __PACKAGE__->load_components(qw( Tree::AdjacencyList ... ));
   # If you want positionable data make sure this 
   # module comes first, as in:
-  __PACKAGE__->load_components(qw( Tree::AdjacencyList Positioned ... ));
+  __PACKAGE__->load_components(qw( Tree::AdjacencyList Positional ... ));
 
 Specify the column that contains the parent ID each row.
 
@@ -63,8 +63,8 @@ other rows.
 Declares the name of the column that contains the self-referential 
 ID which defines the parent row.  Defaults to "parent_id".
 
-If you are useing the Positioned component then this parent_column 
-will automatically be used as the collection_column.
+If you are useing the L<DBIx::Class::Positional> component then this 
+parent_column will automatically be used as the collection_column.
 
 =cut
 
@@ -81,7 +81,7 @@ parent ID.  If setting the parent ID then 0 will be returned
 if the object already has the specified parent, and 1 on 
 success.
 
-If you are using the Positioned component this 
+If you are using the L<DBIx::Class::Positional> component this 
 module will first move the object to the last position of 
 the list, change the parent ID, then move the object to the 
 last position of the new list.  This ensures the intergrity 
@@ -97,10 +97,10 @@ sub parent {
             $new_parent = $new_parent->id() || 0;
         }
         return 0 if ($new_parent == ($self->get_column($parent_column)||0));
-        my $is_positioned = $self->isa('DBIx::Class::Positioned');
-        $self->move_last() if ($is_positioned);
+        my $is_positional = $self->isa('DBIx::Class::Positional');
+        $self->move_last() if ($is_positional);
         $self->set_column( $parent_column => $new_parent );
-        if ($is_positioned) {
+        if ($is_positional) {
             $self->set_column(
                 $self->position_column() => $self->search( {$self->_collection_clause()} )->count() + 1
             );
@@ -121,7 +121,7 @@ sub parent {
 Returns a list or record set, depending on context, of all 
 the objects one level below the current one.
 
-If you are using the Positioned component then this method 
+If you are using the L<DBIx::Class::Positional> component then this method 
 will return the children sorted by the position column.
 
 =cut
@@ -144,10 +144,10 @@ need to use them.
 =head2 _collection_clause
 
 This method is provided as an override of the method in 
-DBIx::Class::Positioned.  This way Positioned and Tree::AdjacencyList 
+L<DBIx::Class::Positional>.  This way Positional and Tree::AdjacencyList 
 may be used together without conflict.  Make sure that in 
 your component list that you load Tree::AdjacencyList before you 
-load Positioned.
+load Positional.
 
 =cut
 
similarity index 76%
rename from t/helperrels/26positioned.t
rename to t/helperrels/26positional.t
index 8e42bbd..d4cc2e7 100644 (file)
@@ -3,5 +3,5 @@ use lib qw(t/lib);
 use DBICTest;
 use DBICTest::HelperRels;
 
-require "t/run/26positioned.tl";
+require "t/run/26positional.tl";
 run_tests(DBICTest->schema);
index e43c898..90308ab 100644 (file)
@@ -7,7 +7,7 @@ no warnings qw/qw/;
 
 __PACKAGE__->load_classes(qw/
   Artist
-  Employee::Positioned
+  Employee::Positional
   Employee::AdjacencyList
   CD
   #dummy
index 5af4532..50f7abd 100644 (file)
@@ -5,7 +5,7 @@ use base 'DBIx::Class';
 
 __PACKAGE__->load_components(qw(
     Tree::AdjacencyList
-    Positioned
+    Positional
     PK::Auto
     Core
 ));
similarity index 82%
rename from t/lib/DBICTest/Schema/Employee/Positioned.pm
rename to t/lib/DBICTest/Schema/Employee/Positional.pm
index 3ce5744..6234132 100644 (file)
@@ -1,11 +1,11 @@
 package # hide from PAUSE 
-    DBICTest::Schema::Employee::Positioned;
+    DBICTest::Schema::Employee::Positional;
 
 use base 'DBIx::Class';
 
-__PACKAGE__->load_components(qw( Positioned PK::Auto Core ));
+__PACKAGE__->load_components(qw( Positional PK::Auto Core ));
 
-__PACKAGE__->table('employees_positioned');
+__PACKAGE__->table('employees_positional');
 
 __PACKAGE__->add_columns(
     employee_id => {
index 1e8f83e..81d56ae 100644 (file)
@@ -1,6 +1,6 @@
 -- 
 -- Created by SQL::Translator::Producer::SQLite
--- Created on Thu Mar 23 19:41:26 2006
+-- Created on Fri Mar 24 07:13:26 2006
 -- 
 BEGIN TRANSACTION;
 
@@ -13,16 +13,6 @@ CREATE TABLE serialized (
 );
 
 --
--- Table: employees_positioned
---
-CREATE TABLE employees_positioned (
-  employee_id INTEGER PRIMARY KEY NOT NULL,
-  position integer NOT NULL,
-  group_id integer,
-  name varchar(100)
-);
-
---
 -- Table: employees_adjacencylist
 --
 CREATE TABLE employees_adjacencylist (
@@ -122,6 +112,16 @@ CREATE TABLE twokeys (
 );
 
 --
+-- Table: employees_positional
+--
+CREATE TABLE employees_positional (
+  employee_id INTEGER PRIMARY KEY NOT NULL,
+  position integer NOT NULL,
+  group_id integer,
+  name varchar(100)
+);
+
+--
 -- Table: fourkeys
 --
 CREATE TABLE fourkeys (
similarity index 95%
rename from t/run/26positioned.tl
rename to t/run/26positional.tl
index 224e658..6d179b7 100644 (file)
@@ -5,7 +5,7 @@ sub run_tests {
     plan tests => 321;
     my $schema = shift;
 
-    my $employees = $schema->resultset('Employee::Positioned');
+    my $employees = $schema->resultset('Employee::Positional');
     $employees->delete();
 
     foreach (1..5) {
@@ -16,7 +16,7 @@ sub run_tests {
 
     hammer_rs( $employees );
 
-    DBICTest::Employee::Positioned->collection_column('group_id');
+    DBICTest::Employee::Positional->collection_column('group_id');
     $employees->delete();
     foreach my $group_id (1..3) {
         foreach (1..6) {