'SQL::Abstract::Limit' => 0.101,
'DBD::SQLite' => 1.08,
'Class::C3' => 0.07,
- 'Tie::IxHash' => 0,
- 'Module::Find' => 0,
'Storable' => 0,
'Class::Data::Accessor' => 0.01,
'Carp::Clan' => 0,
},
recommends => {
'Data::UUID' => 0,
+ 'Module::Find' => 0,
},
create_makefile_pl => 'passthrough',
create_readme => 1,
=head2 register_column($column, $column_info)
- Registers a column on the class and creates an accessor for it
+ Registers a column on the class. If the column_info has an 'accessor' key,
+ creates an accessor named after the value if defined; if there is no such
+ key, creates an accessor with the same name as the column
=cut
sub register_column {
my ($class, $col, $info) = @_;
- $class->mk_group_accessors('column' => $col);
+ my $acc = $col;
+ if (exists $info->{accessor}) {
+ return unless defined $info->{accessor};
+ $acc = [ $info->{accessor}, $col ];
+ }
+ $class->mk_group_accessors('column' => $acc);
}
ok($new->in_storage, 'insert_or_update insert ok');
# test in update mode
-$new->position(5);
+$new->pos(5);
$new->insert_or_update;
-is( $schema->resultset("Track")->find(100)->position, 5, 'insert_or_update update ok');
+is( $schema->resultset("Track")->find(100)->pos, 5, 'insert_or_update update ok');
eval { $schema->class("Track")->load_components('DoesNotExist'); };