Purge affected pages on insert/update/delete
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Contest.pm
index e7b72259d7b10fc05c3736a7200347f4fd3405ea..a82bc0f2a4fdb85ffc71b9924ea79dec84b536d2 100644 (file)
@@ -171,8 +171,15 @@ __PACKAGE__->many_to_many("problems", "contest_problems", "problem");
 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IxxZqQwKisBwDabCNUD55Q
 
+use Class::Method::Modifiers qw/after/;
 use List::Util qw/sum/;
 
+after qw/insert update delete/ => sub {
+       my ($self) = @_;
+       Gruntmaster::Data::purge '/ct/';
+       Gruntmaster::Data::purge '/ct/' . $self->id;
+};
+
 sub is_pending {
        my ($self, $time) = @_;
        $self->start > ($time // time)
This page took 0.009661 seconds and 4 git commands to generate.