Showing 3 changed files with 4 additions and 2 deletions
+1
Changes
... ...
@@ -1,4 +1,5 @@
1 1
 0.1694
2
+    - DBIx::Custom::Result type_rule method on setting return self 
2 3
     - reserved_word_quote is DEPRECATED! this is renamed to quote
3 4
     - DBIx::Custom::Model type attribute is DEPRECATED!
4 5
       this is renamed to bind_type.
+2
lib/DBIx/Custom/Result.pm
... ...
@@ -217,6 +217,8 @@ sub type_rule {
217 217
         if (@_ == 1) { $self->{type_rule} = $type_rule }
218 218
         # Merge
219 219
         else { $self->{type_rule} = {%{$self->type_rule}, %$type_rule} }
220
+        
221
+        return $self;
220 222
     }
221 223
     
222 224
     return $self->{type_rule} ||= {};
+1 -2
t/dbix-custom-core-sqlite.t
... ...
@@ -2763,8 +2763,7 @@ $dbi->type_rule(
2763 2763
 );
2764 2764
 $dbi->insert({key1 => 2}, table => 'table1', type_rule_off => 1);
2765 2765
 $result = $dbi->select(table => 'table1', type_rule_off => 1);
2766
-$result->type_rule_off(1);
2767
-is($result->fetch->[0], 2);
2766
+is($result->type_rule_off(1)->fetch->[0], 2);
2768 2767
 
2769 2768
 $dbi = DBIx::Custom->connect(dsn => 'dbi:SQLite:dbname=:memory:');
2770 2769
 $dbi->execute("create table table1 (key1 Date, key2 datetime)");