From dbd5376d42beb4744e9e9e2a020f878a2821b00b Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 5 Sep 2013 15:43:06 +0100 Subject: Spell out all "marked as %s" strings. As doing interpolation from a database state field is not great for translation. Fixes #391. --- perllib/FixMyStreet/DB/Result/Comment.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm') diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index eb9e52a65..c747f7fc1 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -179,8 +179,8 @@ sub get_photo_params { =head2 meta_problem_state -Returns a string suitable for display in the update meta section. -Mostly removes the '- council/user' bit from fixed states +Returns a string suitable for display lookup in the update meta section. +Removes the '- council/user' bit from fixed states. =cut @@ -190,10 +190,6 @@ sub meta_problem_state { my $state = $self->problem_state; $state =~ s/ -.*$//; - $state = _("not the council's responsibility") - if $state eq 'not responsible'; - $state = _('duplicate report') if $state eq 'duplicate'; - return $state; } -- cgit v1.2.3 From 0f0c8e92fa4930a6a951b856bf86e8bbf322a008 Mon Sep 17 00:00:00 2001 From: Edmund von der Burg Date: Tue, 10 Sep 2013 14:31:17 +0100 Subject: Use RABXColumn in remaining models that serialize some columns --- perllib/FixMyStreet/DB/Result/Comment.pm | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm') diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index c747f7fc1..d1626599e 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -85,32 +85,13 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-07-11 18:53:26 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tSejJzLxHD/fMWjpa10lfA -__PACKAGE__->filter_column( - extra => { - 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('extra'); use DateTime::TimeZone; use Image::Size; use Moose; use namespace::clean -except => [ 'meta' ]; -use RABX; with 'FixMyStreet::Roles::Abuser'; -- cgit v1.2.3 From df38951bce57fddf5d4de658b239191f912d5973 Mon Sep 17 00:00:00 2001 From: Chris Mytton Date: Tue, 10 Sep 2013 17:33:57 +0100 Subject: Update DB/Result/* with latest DBIx::Class::Schema::Loader Version 0.07027 of DBIx::Class::Schema::Loader introduced some changes to the way it generates schemas. > PostgreSQL WARNING: the default for on_delete/on_update attributes for > belongs_to relationships is now 'NO ACTION' not 'CASCADE! The default > for is_deferrable is now 0 not 1. --- perllib/FixMyStreet/DB/Result/Comment.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm') diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index c747f7fc1..c712ad4e1 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -54,6 +54,10 @@ __PACKAGE__->add_columns( { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "problem_state", { data_type => "text", is_nullable => 1 }, + "external_id", + { data_type => "text", is_nullable => 1 }, + "extra", + { data_type => "text", is_nullable => 1 }, "send_fail_count", { data_type => "integer", default_value => 0, is_nullable => 0 }, "send_fail_reason", @@ -62,28 +66,24 @@ __PACKAGE__->add_columns( { data_type => "timestamp", is_nullable => 1 }, "whensent", { data_type => "timestamp", is_nullable => 1 }, - "external_id", - { data_type => "text", is_nullable => 1 }, - "extra", - { data_type => "text", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( "problem", "FixMyStreet::DB::Result::Problem", { id => "problem_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); __PACKAGE__->belongs_to( "user", "FixMyStreet::DB::Result::User", { id => "user_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-07-11 18:53:26 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tSejJzLxHD/fMWjpa10lfA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D/+UWcF7JO/EkCiJaAHUOw __PACKAGE__->filter_column( extra => { -- cgit v1.2.3