Showing 4 changed files with 25 additions and 40 deletions
+2
Changes
... ...
@@ -1,3 +1,5 @@
1
+0.1621
2
+  cleanup (removed undocumented features)
1 3
 0.1620
2 4
   updated document
3 5
 0.1619
+7 -9
lib/DBIx/Custom.pm
... ...
@@ -1,6 +1,6 @@
1 1
 package DBIx::Custom;
2 2
 
3
-our $VERSION = '0.1620';
3
+our $VERSION = '0.1621';
4 4
 
5 5
 use 5.008001;
6 6
 use strict;
... ...
@@ -34,8 +34,12 @@ __PACKAGE__->attr(cache_method => sub {
34 34
     }
35 35
 });
36 36
 
37
-__PACKAGE__->dual_attr('filters', default => sub { {} },
38
-                                  inherit => 'hash_copy');
37
+__PACKAGE__->attr(filters => sub {
38
+    {
39
+        encode_utf8 => sub { encode_utf8($_[0]) },
40
+        decode_utf8 => sub { decode_utf8($_[0]) }
41
+    }
42
+});
39 43
 __PACKAGE__->attr(filter_check => 1);
40 44
 __PACKAGE__->attr(query_builder  => sub {DBIx::Custom::QueryBuilder->new});
41 45
 __PACKAGE__->attr(result_class => 'DBIx::Custom::Result');
... ...
@@ -53,12 +57,6 @@ foreach my $method (qw/begin_work commit rollback/) {
53 57
     *{"${pkg}::$method"} = $code;
54 58
 };
55 59
 
56
-# Regster filter
57
-__PACKAGE__->register_filter(
58
-    encode_utf8 => sub { encode_utf8($_[0]) },
59
-    decode_utf8 => sub { decode_utf8($_[0]) }
60
-);
61
-
62 60
 our $AUTOLOAD;
63 61
 
64 62
 sub AUTOLOAD {
+15 -16
lib/DBIx/Custom/QueryBuilder.pm
... ...
@@ -13,22 +13,21 @@ use DBIx::Custom::QueryBuilder::TagProcessors;
13 13
 push @DBIx::Custom::CARP_NOT, __PACKAGE__;
14 14
 
15 15
 # Attributes
16
-__PACKAGE__->dual_attr('tag_processors', default => sub { {} }, inherit => 'hash_copy');
17
-
18
-# Resister tag processor
19
-__PACKAGE__->register_tag_processor(
20
-    '?'     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_placeholder_tag,
21
-    '='     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_equal_tag,
22
-    '<>'    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_not_equal_tag,
23
-    '>'     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_greater_than_tag,
24
-    '<'     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_lower_than_tag,
25
-    '>='    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_greater_than_equal_tag,
26
-    '<='    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_lower_than_equal_tag,
27
-    'like'  => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_like_tag,
28
-    'in'    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_in_tag,
29
-    'insert_param' => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_insert_param_tag,
30
-    'update_param' => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_update_param_tag
31
-);
16
+__PACKAGE__->attr('tag_processors' => sub {
17
+    {
18
+        '?'     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_placeholder_tag,
19
+        '='     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_equal_tag,
20
+        '<>'    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_not_equal_tag,
21
+        '>'     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_greater_than_tag,
22
+        '<'     => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_lower_than_tag,
23
+        '>='    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_greater_than_equal_tag,
24
+        '<='    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_lower_than_equal_tag,
25
+        'like'  => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_like_tag,
26
+        'in'    => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_in_tag,
27
+        'insert_param' => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_insert_param_tag,
28
+        'update_param' => \&DBIx::Custom::QueryBuilder::TagProcessors::expand_update_param_tag
29
+    }
30
+});
32 31
 
33 32
 sub build_query {
34 33
     my ($self, $source)  = @_;
+1 -15
t/dbix-custom-core.t
... ...
@@ -1,4 +1,4 @@
1
-use Test::More tests => 15;
1
+use Test::More tests => 11;
2 2
 use strict;
3 3
 use warnings;
4 4
 
... ...
@@ -42,9 +42,6 @@ test 'Sub class constructor';
42 42
     package DBIx::Custom::T1;
43 43
     use base 'DBIx::Custom';
44 44
     
45
-    __PACKAGE__
46
-      ->filters({f => 3})
47
-    ;
48 45
 }
49 46
 $dbi = DBIx::Custom::T1->new(
50 47
     filters => {
... ...
@@ -53,19 +50,12 @@ $dbi = DBIx::Custom::T1->new(
53 50
 );
54 51
 is_deeply(scalar $dbi->filters, {fo => 30}, "$test : filters");
55 52
 
56
-test 'Sub class constructor default';
57
-$dbi = DBIx::Custom::T1->new;
58
-is_deeply($dbi->filters, {f => 3}, "$test : filters");
59
-isa_ok($dbi, 'DBIx::Custom::T1');
60
-
61
-
62 53
 test 'Sub sub class constructor default';
63 54
 {
64 55
     package DBIx::Custom::T1_2;
65 56
     use base 'DBIx::Custom::T1';
66 57
 }
67 58
 $dbi = DBIx::Custom::T1_2->new;
68
-is_deeply(scalar $dbi->filters, {f => 3}, "$test : filters");
69 59
 isa_ok($dbi, 'DBIx::Custom::T1_2');
70 60
 
71 61
 
... ...
@@ -74,12 +64,8 @@ test 'Customized sub class constructor default';
74 64
     package DBIx::Custom::T1_3;
75 65
     use base 'DBIx::Custom::T1';
76 66
     
77
-    __PACKAGE__
78
-      ->filters({fo => 30})
79
-    ;
80 67
 }
81 68
 $dbi = DBIx::Custom::T1_3->new;
82
-is_deeply(scalar $dbi->filters, {fo => 30}, "$test : filters");
83 69
 isa_ok($dbi, 'DBIx::Custom::T1_3');
84 70
 
85 71