my %att;
foreach my $col (keys %{ $class->_columns }) {
my $field = $class->get_field($col);
- if ($class->can('accessor_name')) {
- my $acc = $class->accessor_name($col);
- $field->set_accessor_name($acc);
- $att{$col} = delete $attrs->{$acc} if exists $attrs->{$acc};
- }
- if ($class->can('mutator_name')) {
- my $mut = $class->mutator_name($col);
- $field->set_mutator_name($mut);
- $att{$col} = delete $attrs->{$mut} if exists $attrs->{$mut};
- }
+
+ my $acc = $field->get_accessor_name;
+ $att{$col} = delete $attrs->{$acc} if exists $attrs->{$acc};
+
+ my $mut = $field->get_mutator_name;
+ $att{$col} = delete $attrs->{$mut} if exists $attrs->{$mut};
}
return $class->NEXT::ACTUAL::create({ %$attrs, %att }, @rest);
}
foreach my $col (@cols) {
$groups->{$group}{$col} ||= {};
-# $class->set_field_column_name($col => $col);
-#
-# my $field = $class->get_field($col);
-#
-# if($class->can('accessor_name')) {
-# $field->set_accessor_name($class->accessor_name($col));
-# }
-# if($class->can('mutator_name')) {
-# $field->set_mutator_name($class->mutator_name($col));
-# }
-#
-# $class->_columns->{$col}{field} = $field;
+ $class->set_field_column_name($col => $col);
+
+ my $field = $class->get_field($col);
+
+ if($class->can('accessor_name')) {
+ $field->set_accessor_name($class->accessor_name($col));
+ }
+ if($class->can('mutator_name')) {
+ $field->set_mutator_name($class->mutator_name($col));
+ }
}
#if ($group eq 'Essential') {