Added fix to avoid undef warnings in CDBICompat stringify
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Table.pm
index 32f101d..42631de 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use DBIx::Class::ResultSet;
+use Data::Page;
 
 use base qw/Class::Data::Inheritable/;
 
@@ -112,9 +113,9 @@ sub search {
     $attrs = { %{ pop(@_) } };
   }
   $attrs->{where} = (@_ == 1 || ref $_[0] eq "HASH" ? shift: {@_});
-
+  
   my $rs = $class->resultset($attrs);
-
+  
   return (wantarray ? $rs->all : $rs);
 }
 
@@ -169,7 +170,7 @@ creates one and returns that instead
 sub find_or_create {
   my $class    = shift;
   my $hash     = ref $_[0] eq "HASH" ? shift: {@_};
-  my ($exists) = $class->search($hash);
+  my $exists = $class->find($hash);
   return defined($exists) ? $exists : $class->create($hash);
 }
 
@@ -181,7 +182,7 @@ sub columns { return keys %{shift->_columns}; }
 
 =head1 AUTHORS
 
-Matt S. Trout <perl-stuff@trout.me.uk>
+Matt S. Trout <mst@shadowcatsystems.co.uk>
 
 =head1 LICENSE