allow get_column to take anything coerceable into a Column (currently only Str, HashR...
Justin Hunter [Tue, 21 Jun 2011 18:27:35 +0000 (11:27 -0700)]
lib/SQL/Translator/Object/Table.pm

index 35f9d9e..8840f7c 100644 (file)
@@ -99,6 +99,10 @@ class SQL::Translator::Object::Table extends SQL::Translator::Object is dirty {
         isa => Int,
     );
 
+    around get_column(Column $column does coerce) {
+        $self->$orig($column->name);
+    }
+
     around add_column(Column $column does coerce) {
         die "Can't use column name " . $column->name if $self->exists_column($column->name) || $column->name eq '';
         $column->table($self);