aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-08-23 17:28:11 +0100
committerDave Arter <davea@mysociety.org>2016-09-08 09:45:58 +0100
commit1444841970096122c9aeb5e86c82bede01b1bee6 (patch)
tree79b96fda21ce35037d05065644a1043077bf1717 /perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
parent80a01c11f656f19d6df4c2e4294f613db14689b1 (diff)
Extend response templates to work across all cobrands
This builds on the response templates in the Zürich cobrand: - Allow response templates to be assigned to categories - Also adds a auto_response flag, which will be used to automatically create updates when reports are made. - Include response templates select box on update form For mysociety/fixmystreetforcouncils#31
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/ResponseTemplate.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/ResponseTemplate.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
index d189bf3ec..0d4377dba 100644
--- a/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
+++ b/perllib/FixMyStreet/DB/Result/ResponseTemplate.pm
@@ -31,6 +31,8 @@ __PACKAGE__->add_columns(
is_nullable => 0,
original => { default_value => \"now()" },
},
+ "auto_response",
+ { data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("response_templates_body_id_title_key", ["body_id", "title"]);
@@ -40,11 +42,18 @@ __PACKAGE__->belongs_to(
{ id => "body_id" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
+__PACKAGE__->has_many(
+ "contact_response_templates",
+ "FixMyStreet::DB::Result::ContactResponseTemplate",
+ { "foreign.response_template_id" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
-# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-07-20 14:38:36
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ECFQLMxOFGwv7cwfHLlszw
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-08-24 11:29:04
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KRm0RHbtrzuxzH0S/UAsdw
+__PACKAGE__->many_to_many( contacts => 'contact_response_templates', 'contact' );
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;