Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Encoded.pm
CommitLineData
f1417dab 1package # hide from PAUSE
2 DBICTest::Schema::Encoded;
3
f1417dab 4use strict;
5use warnings;
6
4a233f30 7use base qw/DBICTest::BaseResult/;
8
f1417dab 9__PACKAGE__->table('encoded');
10__PACKAGE__->add_columns(
11 'id' => {
12 data_type => 'integer',
13 is_auto_increment => 1
14 },
15 'encoded' => {
16 data_type => 'varchar',
17 size => 100,
18 is_nullable => 1,
19 },
20);
21
22__PACKAGE__->set_primary_key('id');
23
68888c09 24__PACKAGE__->has_many (keyholders => 'DBICTest::Schema::Employee', 'encoded');
25
f1417dab 26sub set_column {
27 my ($self, $col, $value) = @_;
28 if( $col eq 'encoded' ){
29 $value = reverse split '', $value;
30 }
31 $self->next::method($col, $value);
32}
33
34sub new {
35 my($self, $attr, @rest) = @_;
36 $attr->{encoded} = reverse split '', $attr->{encoded}
37 if defined $attr->{encoded};
38 return $self->next::method($attr, @rest);
39}
40
411;