Showing 2 changed files with 42 additions and 3 deletions
+5 -3
lib/DBIx/Custom.pm
... ...
@@ -835,10 +835,12 @@ sub include_model {
835 835
     }
836 836
     else {
837 837
       $model_class = $model_name = $model_table = $model_info;
838
-      $model_name =~ s/::/./;
839
-      $model_table =~ s/::/./;
840 838
     }
841
-   
839
+
840
+    $model_class =~ s/\./::/g;
841
+    $model_name =~ s/::/./;
842
+    $model_table =~ s/::/./;
843
+
842 844
     my $mclass = "${name_space}::$model_class";
843 845
     croak qq{"$mclass" is invalid class name } . _subname
844 846
       if $mclass =~ /[^\w:]/;
+37
t/common.t
... ...
@@ -35,6 +35,12 @@ sub hy($) {
35 35
   return $value;
36 36
 }
37 37
 
38
+sub colon2 {
39
+  my $value = shift;
40
+  $value =~ s/\./::/g;
41
+  return $value;
42
+}
43
+
38 44
 # Constant
39 45
 my $table1 = $dbi->table1;
40 46
 my $table2 = $dbi->table2;
... ...
@@ -194,6 +200,37 @@ require MyDBI1;
194 200
   }
195 201
 
196 202
   sub list { shift->select; }
203
+
204
+
205
+  package MyModel2::main::table1;
206
+
207
+  use strict;
208
+  use warnings;
209
+
210
+  use base 'MyModel2::Base1';
211
+
212
+  sub insert {
213
+    my ($self, $param) = @_;
214
+    
215
+    return $self->SUPER::insert($param);
216
+  }
217
+
218
+  sub list { shift->select; }
219
+
220
+  package MyModel2::main::table2;
221
+
222
+  use strict;
223
+  use warnings;
224
+
225
+  use base 'MyModel2::Base1';
226
+
227
+  sub insert {
228
+    my ($self, $param) = @_;
229
+    
230
+    return $self->SUPER::insert($param);
231
+  }
232
+
233
+  sub list { shift->select; }
197 234
 }
198 235
 {
199 236
    package MyDBI5;