Cleaned up and clarified Relationship docs
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / LazyLoading.pm
index ff235e2..b7d3633 100644 (file)
@@ -1,10 +1,14 @@
-package DBIx::Class::CDBICompat::LazyLoading;
+package # hide from PAUSE
+    DBIx::Class::CDBICompat::LazyLoading;
 
 use strict;
 use warnings;
 
-sub _select_columns {
-  return shift->columns('Essential');
+sub resultset_instance {
+  my $self = shift;
+  my $rs = $self->next::method(@_);
+  $rs = $rs->search(undef, { columns => [ $self->columns('Essential') ] });
+  return $rs;
 }
 
 sub get_column {
@@ -18,6 +22,11 @@ sub get_column {
   $self->next::method(@_[1..$#_]);
 }
 
+sub _ident_cond {
+  my ($class) = @_;
+  return join(" AND ", map { "$_ = ?" } $class->primary_columns);
+}
+
 sub _flesh {
   my ($self, @groups) = @_;
   @groups = ('All') unless @groups;