move from curries to provides => { set => 'add_...' } and around add_... { }
[dbsrgits/SQL-Translator-2.0-ish.git] / lib / SQL / Translator / Object / Index.pm
index d7ac8b5..be3142d 100644 (file)
@@ -20,14 +20,7 @@ class SQL::Translator::Object::Index {
             keys   => 'column_ids',
             values => 'get_columns',
             get    => 'get_column',
-        },
-        curries => {
-            set => {
-                add_column => sub {
-                    my ($self, $body, $column) = @_;
-                    $self->$body($column->name, $column);
-                }
-            }
+            set    => 'add_column',
         },
         default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
     );
@@ -50,6 +43,8 @@ class SQL::Translator::Object::Index {
         auto_deref => 1,
     );
 
+    around add_column(Column $column) { $self->$orig($column->name, $column) }
+
     method get_fields { return $self->get_columns }
     method fields { return $self->column_ids }
 }