Merge 'DBIx-Class-current' into 'find_changes'
Daniel Westermann-Clark [Tue, 18 Apr 2006 18:19:31 +0000 (18:19 +0000)]
Changes
lib/DBIx/Class/Componentised.pm
lib/DBIx/Class/Manual/Cookbook.pod
lib/DBIx/Class/Relationship.pm
lib/DBIx/Class/ResultSource.pm
t/05components.t

diff --git a/Changes b/Changes
index 948ae23..ea392d3 100644 (file)
--- a/Changes
+++ b/Changes
@@ -6,10 +6,9 @@ Revision history for DBIx::Class
        - load_classes now uses source_name and sets it if necessary
 
 0.06002
-        - nuke ResultSource caching of ->resultset for consistency reasons
         - fix for -and conditions when updating or deleting on a ResultSet
 
-0.06001 2006-04-08 21:48:43
+0.06001
         - minor fix to update in case of undefined rels
         - fixes for cascade delete
         - substantial improvements and fixes to deploy
@@ -20,14 +19,14 @@ Revision history for DBIx::Class
         - bugfix to Cursor to avoid error during DESTROY
         - transaction DBI operations now in debug trace output
 
-0.06000 2006-03-25 18:03:46
+0.06000
         - Lots of documentation improvements
         - Minor tweak to related_resultset to prevent it storing a searched rs
         - Fixup to columns_info_for when database returns type(size)
         - Made do_txn respect void context (on the off-chance somebody cares)
         - Fix exception text for nonexistent key in ResultSet::find()
 
-0.05999_04 2006-03-18 19:20:49
+0.05999_04
         - Fix for delete on full-table resultsets
         - Removed caching on count() and added _count for pager()
         - ->connection does nothing if ->storage defined and no args
index 7e62354..a8a17c3 100644 (file)
@@ -10,11 +10,7 @@ sub inject_base {
   my ($class, $target, @to_inject) = @_;
   {
     no strict 'refs';
-    my %seen;
-    unshift( @{"${target}::ISA"},
-        grep { !$seen{ $_ }++ && $target ne $_ && !$target->isa($_) }
-            @to_inject
-    );
+    unshift(@{"${target}::ISA"}, grep { $target ne $_ && !$target->isa($_)} @to_inject);
   }
 
   # Yes, this is hack. But it *does* work. Please don't submit tickets about
index 35b7d40..ed00d46 100644 (file)
@@ -562,8 +562,8 @@ instead:
                          },
   );
   
-  $translator->parser('SQL::Translator::Parser::DBIx::Class');
-  $translator->producer('SQL::Translator::Producer::DBIx::Class::File');
+  $translator->parser('DBIx::Class');
+  $translator->producer('DBIx::Class::File');
   
   my $output = $translator->translate(@args) or die
           "Error: " . $translator->error;
index 44ed65b..77bfa8c 100644 (file)
@@ -31,7 +31,7 @@ DBIx::Class::Relationship - Inter-table relationships
 
   $schema->resultset('Actor')->roles();
   $schema->resultset('Role')->search_related('actors', { Name => 'Fred' });
-  $schema->resultset('ActorRole')->add_to_roles({ Name => 'Sherlock Holmes'});
+  $schema->resultset('ActorRole')->add_to_role({ Name => 'Sherlock Holmes'});
 
 See L<DBIx::Class::Manual::Cookbook> for more.
 
@@ -184,7 +184,7 @@ left join.
                                             'My::DBIC::Schema::Actor' );
 
   My::DBIC::Schema::Actor->many_to_many( roles => 'actor_roles',
-                                         'role' );
+                                         'My::DBIC::Schema::Roles' );
 
   ...
 
index ee96129..1caf03c 100644 (file)
@@ -846,14 +846,9 @@ sub resultset {
     'resultset does not take any arguments. If you want another resultset, '.
     'call it on the schema instead.'
   ) if scalar @_;
-
-  # disabled until we can figure out a way to do it without consistency issues
-  #
-  #return $self->{_resultset}
-  #  if ref $self->{_resultset} eq $self->resultset_class;
-  #return $self->{_resultset} =
-
-  return $self->resultset_class->new(
+  return $self->{_resultset}
+    if ref $self->{_resultset} eq $self->resultset_class;
+  return $self->{_resultset} = $self->resultset_class->new(
     $self, $self->{resultset_attributes}
   );
 }
index fd0742f..57bebd5 100644 (file)
@@ -7,27 +7,8 @@ use Test::More;
 use lib qw(t/lib);
 use DBICTest::ForeignComponent;
 
-plan tests => 2;
+plan tests => 1;
 
 #   Tests if foreign component was loaded by calling foreign's method
 ok( DBICTest::ForeignComponent->foreign_test_method, 'foreign component' );
 
-#   Test for inject_base to filter out duplicates
-{   package DBICTest::_InjectBaseTest;
-    use base qw/ DBIx::Class /;
-}
-DBICTest::_InjectBaseTest->inject_base( 'DBICTest::_InjectBaseTest', qw/
-    DBICTest::_InjectBaseTest::A
-    DBICTest::_InjectBaseTest::B
-    DBICTest::_InjectBaseTest::B
-    DBICTest::_InjectBaseTest::C
-/);
-is_deeply( \@DBICTest::_InjectBaseTest::ISA,
-    [qw/
-        DBICTest::_InjectBaseTest::A
-        DBICTest::_InjectBaseTest::B
-        DBICTest::_InjectBaseTest::C
-        DBIx::Class
-    /],
-    'inject_base filters duplicates'
-);