Purge affected pages on insert/update/delete
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / ProblemStatus.pm
CommitLineData
adb42d4d
MG
1use utf8;
2package Gruntmaster::Data::Result::ProblemStatus;
3
4# Created by DBIx::Class::Schema::Loader
5# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7=head1 NAME
8
be2f7678 9Gruntmaster::Data::Result::ProblemStatus - List of (problem, user, result)
adb42d4d
MG
10
11=cut
12
13use strict;
14use warnings;
15
16use base 'DBIx::Class::Core';
17
18=head1 TABLE: C<problem_status>
19
20=cut
21
22__PACKAGE__->table("problem_status");
23
24=head1 ACCESSORS
25
26=head2 problem
27
28 data_type: 'text'
29 is_foreign_key: 1
30 is_nullable: 0
31
32=head2 owner
33
34 data_type: 'text'
35 is_foreign_key: 1
36 is_nullable: 0
37
38=head2 job
39
40 data_type: 'integer'
41 is_auto_increment: 1
42 is_foreign_key: 1
43 is_nullable: 0
44 sequence: 'problem_status_job_seq'
45
46=head2 solved
47
48 data_type: 'boolean'
49 default_value: false
50 is_nullable: 0
51
be2f7678
MG
52True if the result is Accepted, False otherwise
53
adb42d4d
MG
54=cut
55
56__PACKAGE__->add_columns(
57 "problem",
58 { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
59 "owner",
60 { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
61 "job",
62 {
63 data_type => "integer",
64 is_auto_increment => 1,
65 is_foreign_key => 1,
66 is_nullable => 0,
67 sequence => "problem_status_job_seq",
68 },
69 "solved",
70 { data_type => "boolean", default_value => \"false", is_nullable => 0 },
71);
72
73=head1 PRIMARY KEY
74
75=over 4
76
77=item * L</owner>
78
79=item * L</problem>
80
81=back
82
83=cut
84
85__PACKAGE__->set_primary_key("owner", "problem");
86
87=head1 RELATIONS
88
89=head2 job
90
91Type: belongs_to
92
93Related object: L<Gruntmaster::Data::Result::Job>
94
95=cut
96
97__PACKAGE__->belongs_to(
98 "job",
99 "Gruntmaster::Data::Result::Job",
100 { id => "job" },
101 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
102);
103
104=head2 owner
105
106Type: belongs_to
107
108Related object: L<Gruntmaster::Data::Result::User>
109
110=cut
111
112__PACKAGE__->belongs_to(
113 "owner",
114 "Gruntmaster::Data::Result::User",
115 { id => "owner" },
116 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
117);
118
119=head2 problem
120
121Type: belongs_to
122
123Related object: L<Gruntmaster::Data::Result::Problem>
124
125=cut
126
127__PACKAGE__->belongs_to(
128 "problem",
129 "Gruntmaster::Data::Result::Problem",
130 { id => "problem" },
131 { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
132);
133
134
be2f7678
MG
135# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
136# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1OCTO6sM27DamVhQi3dWKg
adb42d4d 137
de7226ca
MG
138use Class::Method::Modifiers qw/after/;
139
c9311d50 140sub rawowner { shift->get_column('owner') }
adb42d4d 141
de7226ca
MG
142after qw/insert update delete/ => sub {
143 my ($self) = @_;
144 Gruntmaster::Data::purge '/us/';
145 Gruntmaster::Data::purge '/us/' . $self->rawowner;
146};
147
adb42d4d 1481;
This page took 0.018381 seconds and 4 git commands to generate.