diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-07-16 21:52:54 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-08-09 17:14:49 +0100 |
commit | fe4153e367bcbb74eebed9c8ac0126d94709506c (patch) | |
tree | 692cb8c92ccbc894809b89f63d17c028fd026745 /perllib/FixMyStreet/DB | |
parent | e00c75d7f19bc45879c254ea77dce32df825f3a7 (diff) |
Set up translatable body name.
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Body.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Schema.pm | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm index 9a64d1608..db7777053 100644 --- a/perllib/FixMyStreet/DB/Result/Body.pm +++ b/perllib/FixMyStreet/DB/Result/Body.pm @@ -121,12 +121,19 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-02-13 15:11:11 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BOJANVwg3kR/1VjDq0LykA +use Moo; +use namespace::clean; + +with 'FixMyStreet::Roles::Translatable'; + sub url { my ( $self, $c, $args ) = @_; # XXX $areas_info was used here for Norway parent - needs body parents, I guess return $c->uri_for( '/reports/' . $c->cobrand->short_name( $self ), $args || {} ); } +around name => \&translate_around; + sub areas { my $self = shift; my %ids = map { $_->area_id => 1 } $self->body_areas->all; diff --git a/perllib/FixMyStreet/DB/Schema.pm b/perllib/FixMyStreet/DB/Schema.pm index 7833ee68c..45d731c33 100644 --- a/perllib/FixMyStreet/DB/Schema.pm +++ b/perllib/FixMyStreet/DB/Schema.pm @@ -18,8 +18,11 @@ __PACKAGE__->load_namespaces( # Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-07-13 14:15:09 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UpH30RXb6SbCqRv2FPmpkg +use Moo; use FixMyStreet; __PACKAGE__->connection(FixMyStreet->dbic_connect_info); +has lang => ( is => 'rw' ); + 1; |