test replication test fail
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index 171218b..492720c 100644 (file)
@@ -9,6 +9,7 @@ use DBIx::Class::ResultSourceHandle;
 use DBIx::Class::Exception;
 use Carp::Clan qw/^DBIx::Class/;
 use Try::Tiny;
+use namespace::clean;
 
 use base qw/DBIx::Class/;
 
@@ -143,7 +144,7 @@ by supplying an L</accessor> in the column_info hash.
 If a column name beginning with a plus sign ('+col1') is provided, the
 attributes provided will be merged with any existing attributes for the
 column, with the new attributes taking precedence in the case that an
-attribute already exists. Using this without a hashref 
+attribute already exists. Using this without a hashref
 (C<< $source->add_columns(qw/+col1 +col2/) >>) is legal, but useless --
 it does the same thing it would do without the plus.
 
@@ -175,7 +176,7 @@ the name of the column will be used.
 
 This contains the column type. It is automatically filled if you use the
 L<SQL::Translator::Producer::DBIx::Class::File> producer, or the
-L<DBIx::Class::Schema::Loader> module. 
+L<DBIx::Class::Schema::Loader> module.
 
 Currently there is no standard set of values for the data_type. Use
 whatever your database supports.
@@ -368,11 +369,10 @@ sub column_info {
     $self->{_columns_info_loaded}++;
     my $info = {};
     my $lc_info = {};
+
     # try for the case of storage without table
-    my $caught;
-    try { $info = $self->storage->columns_info_for( $self->from ) }
-    catch { $caught = 1 };
-    unless ($caught) {
+    try {
+      $info = $self->storage->columns_info_for( $self->from );
       for my $realcol ( keys %{$info} ) {
         $lc_info->{lc $realcol} = $info->{$realcol};
       }
@@ -382,7 +382,7 @@ sub column_info {
           %{ $info->{$col} || $lc_info->{lc $col} || {} }
         };
       }
-    }
+    };
   }
   return $self->_columns->{$column};
 }
@@ -900,7 +900,7 @@ clause contents.
 
   my $schema = $source->schema();
 
-Returns the L<DBIx::Class::Schema> object that this result source 
+Returns the L<DBIx::Class::Schema> object that this result source
 belongs to.
 
 =head2 storage
@@ -1025,7 +1025,7 @@ sub add_relationship {
 
   return $self;
 
-  # XXX disabled. doesn't work properly currently. skip in tests.
+# XXX disabled. doesn't work properly currently. skip in tests.
 
   my $f_source = $self->schema->source($f_source_name);
   unless ($f_source) {
@@ -1041,10 +1041,11 @@ sub add_relationship {
   try { $self->_resolve_join($rel, 'me', {}, []) }
   catch {
     # If the resolve failed, back out and re-throw the error
-    delete $rels{$rel}; #
+    delete $rels{$rel};
     $self->_relationships(\%rels);
     $self->throw_exception("Error creating relationship $rel: $_");
   };
+
   1;
 }
 
@@ -1478,7 +1479,7 @@ sub _resolve_prefetch {
                     keys %{$rel_info->{cond}};
       my @ord = (ref($rel_info->{attrs}{order_by}) eq 'ARRAY'
                    ? @{$rel_info->{attrs}{order_by}}
-   
+
                 : (defined $rel_info->{attrs}{order_by}
                        ? ($rel_info->{attrs}{order_by})
                        : ()));
@@ -1536,7 +1537,7 @@ sub related_class {
 
 =head2 handle
 
-Obtain a new handle to this source. Returns an instance of a 
+Obtain a new handle to this source. Returns an instance of a
 L<DBIx::Class::ResultSourceHandle>.
 
 =cut