Showing 2 changed files with 14 additions and 4 deletions
+2 -2
lib/DBIx/Custom.pm
... ...
@@ -329,7 +329,7 @@ sub execute {
329 329
     $filter ||= $query->filter;
330 330
     
331 331
     # Tables
332
-    unshift @$tables, @{$query->tables};
332
+    unshift @$tables, @{$query->{tables} || []};
333 333
     my $main_table = pop @$tables;
334 334
     $tables = $self->_remove_duplicate_table($tables, $main_table);
335 335
     if (my $q = $self->_quote) {
... ...
@@ -1135,7 +1135,7 @@ sub _create_query {
1135 1135
             {
1136 1136
                 sql     => $query->sql, 
1137 1137
                 columns => $query->columns,
1138
-                tables  => $query->tables
1138
+                tables  => $query->{tables} || []
1139 1139
             }
1140 1140
         ) if $cache;
1141 1141
     }
+12 -2
lib/DBIx/Custom/Query.pm
... ...
@@ -19,11 +19,21 @@ sub filters {
19 19
     }
20 20
     return $self->{filters};
21 21
 }
22
-has  tables => sub { [] };
22
+
23
+# DEPRECATED!
24
+sub tables {
25
+    warn "DBIx::Custom::Query tables attribute method is DEPRECATED!";
26
+    my $self = shift;
27
+    if (@_) {
28
+        $self->{tables} = $_[0];
29
+        return $self;
30
+    }
31
+    return $self->{tables} ||= [];
32
+}
23 33
 
24 34
 #DEPRECATED!
25 35
 sub filter {
26
-    warn "DBIx::Custom::Query filter method is DEPRECATED!";
36
+    #warn "DBIx::Custom::Query filter method is DEPRECATED!";
27 37
     my $self = shift;
28 38
     if (@_) {
29 39
         my $filter = {};