diff lib/IMPL/SQL/Schema/Constraint.pm @ 417:3ed0c58e9da3 ref20150831

working on di container, tests
author cin
date Mon, 02 Nov 2015 01:56:53 +0300
parents c6e90e02dd17
children
line wrap: on
line diff
--- a/lib/IMPL/SQL/Schema/Constraint.pm	Thu Oct 29 03:50:25 2015 +0300
+++ b/lib/IMPL/SQL/Schema/Constraint.pm	Mon Nov 02 01:56:53 2015 +0300
@@ -20,7 +20,7 @@
 
 sub CTOR {
     my ($this,%args) = @_;
-    is( $args{table}, typeof IMPL::SQL::Schema::Table ) or
+    is( $args{table}, 'IMPL::SQL::Schema::Table' ) or
         die new IMPL::InvalidArgumentException("table argument must be a table object");
     $this->{$name} = $args{'name'};
     $this->{$table} = $args{'table'};
@@ -75,13 +75,13 @@
 sub ResolveAlias {
     my ($self,$alias) = @_;
     
-    return isclass($alias, typeof IMPL::SQL::Schema::Constraint) ? $alias : $aliases{$alias};
+    return isclass($alias, 'IMPL::SQL::Schema::Constraint') ? $alias : $aliases{$alias};
 }
 
 sub RegisterAlias {
     my ($self,$alias) = @_;
     
-    $aliases{$alias} = typeof($self);
+    $aliases{$alias} = ref $self ? typeof($self) : $self;
 }
 
 1;