diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2013-09-10 14:26:48 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2013-09-10 14:26:48 +0100 |
commit | affebc1ce59e850ccc50013bdcccc89c6846c89a (patch) | |
tree | fea1a40cf9014fbf78d1bc5a22899ff089e42d5f /perllib/FixMyStreet/DB | |
parent | d3886845bf52bdb4af465e90a296b91ceb8b6500 (diff) |
Switch Token over to use RABXColumn and test that changes to the col behave as expected
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Token.pm | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Token.pm b/perllib/FixMyStreet/DB/Result/Token.pm index 028300842..5525fe7a5 100644 --- a/perllib/FixMyStreet/DB/Result/Token.pm +++ b/perllib/FixMyStreet/DB/Result/Token.pm @@ -34,8 +34,6 @@ __PACKAGE__->set_primary_key("scope", "token"); # use mySociety::DBHandle qw(dbh); use mySociety::AuthToken; -use IO::String; -use RABX; =head1 NAME @@ -54,26 +52,9 @@ ms_current_timestamp. =cut -__PACKAGE__->filter_column( - data => { - filter_from_storage => sub { - my $self = shift; - my $ser = shift; - return undef unless defined $ser; - utf8::encode($ser) if utf8::is_utf8($ser); - my $h = new IO::String($ser); - return RABX::wire_rd($h); - }, - filter_to_storage => sub { - my $self = shift; - my $data = shift; - my $ser = ''; - my $h = new IO::String($ser); - RABX::wire_wr( $data, $h ); - return $ser; - }, - } -); +__PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); +__PACKAGE__->rabx_column('data'); + sub new { my ( $class, $attrs ) = @_; |