Showing 2 changed files with 10 additions and 16 deletions
+1
Changes
... ...
@@ -1,4 +1,5 @@
1 1
 0.1723
2
+    - removed EXPERIMENTAL call_dbi method from DBIx::Custom::Model
2 3
     - removed EXPERIMENTAL map_param method from DBIx::Custom
3 4
     - removed EXPERIMENTAL flag from the following DBIx::Custom::Result mehotds
4 5
       filter_on, type_rule, type_rule_off, type_rule_on, type_rule1_off,
+9 -16
lib/DBIx/Custom/Model.pm
... ...
@@ -44,9 +44,15 @@ foreach my $method (@methods) {
44 44
 
45 45
     my $code = sub {
46 46
         my $self = shift;
47
-        my $args = [qw/table bind_type primary_key type/];
48
-        push @$args, 'join' if $method =~ /^select/;
49
-        $self->call_dbi($method, {args => $args}, @_);
47
+        $self->dbi->$method(
48
+            @_ % 2 ? shift : (),
49
+            table => $self->table,
50
+            bind_type => $self->bind_type,
51
+            primary_key => $self->primary_key,
52
+            type => $self->type,
53
+            $method =~ /^select/ ? (join => $self->join) : (), 
54
+            @_
55
+        )
50 56
     };
51 57
     
52 58
     no strict 'refs';
... ...
@@ -54,19 +60,6 @@ foreach my $method (@methods) {
54 60
     *{"${class}::$method"} = $code;
55 61
 }
56 62
 
57
-sub call_dbi {
58
-    my $self = shift;
59
-    my $method = shift;
60
-    my $options = shift;
61
-    my $arg_names = $options->{args};
62
-    
63
-    my @args;
64
-    push @args, ($_ => $self->$_) for @$arg_names;
65
-    unshift @args, shift if @_ % 2;
66
-    
67
-    return $self->dbi->$method(@args, @_);
68
-}
69
-
70 63
 sub execute {
71 64
     my $self = shift;
72 65
     push @_, ($_ => $self->$_) for qw/table bind_type primary_key type/;