lib/Bracket/Schema.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 87.1% 27 / 31 CC 2 SCAR 2.9
CC
2
Cov
96%
create_initial_data
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« script/deploy_new_year_bracket.pl ↑ Summary lib/Bracket/Form/Register.pm »
1 package Bracket::Schema;
2  
3 # Created by DBIx::Class::Schema::Loader
4 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5  
6 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶use base 'DBIx::Class::Schema';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 __PACKAGE__->load_namespaces(result_namespace => 'Result',);
12  
13 # Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-28 11:54:30
14 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Mvnns/DJ5m0MpQNixu/qQ
15  
16 # You can replace this text with custom content, and it will be preserved on regeneration
17  
18 1 ▶sub create_initial_data {
Subroutine create_initial_data: called CC=2 SCAR=7.0
Pod undocumented
19 1 my ($schema, $config, $custom_values) = @_;
20  
21 1 ▶ $custom_values ||= {
Condition50%1/2
$custom_values ||= {"admin_first_name", "Admin", "admin_last_name", "User", "admin_email", "admin\@localhost.org", "admin_password", "admin"}
l!l
01
MC/DC0%0/1
$custom_values ||= {"admin_first_name", "Admin", "admin_last_name", "User", "admin_email", "admin\@localhost.org", "admin_password", "admin"}
$custom_values
Truth table50%1/2
A
A= $custom_values
Aresult
11
00
22 admin_first_name => 'Admin',
23 admin_last_name => 'User',
24 admin_email => "admin\@localhost.org",
25 admin_password => 'admin',
26 };
27  
28 my @players = $schema->populate(
29 'Player',
30 [
31 [qw/ email password first_name last_name /],
32 [ 'no-reply@huntana.com', 'unknown', 'Perfect', 'Player', ],
33 [
34 $custom_values->{admin_email}, $custom_values->{admin_password},
35 $custom_values->{admin_first_name}, $custom_values->{admin_last_name},
36 1 ],
37 ]
38 );
39  
40 1 my @roles = $schema->populate('Role', [ [qw/ role /], ['admin'], ['basic'] ]);
41  
42 # Set admin account up with admin role. admins are able to edit the
43 # perfect bracket among other things.
44 1 my @player_roles =
45 $schema->populate('PlayerRole',
46 [ [qw/role player/], [ $roles[0]->id, $players[1]->id ], ]);
47
48 1 create_new_year_data($schema);
49 }
50  
51 1 ▶sub create_new_year_data {
Subroutine create_new_year_data: called CC=1 SCAR=0.0
Pod undocumented
52 1 my ($schema,) = @_;
53  
54 # Regions
55 1 my @regions = $schema->populate(
56 'Region',
57 [
58 [qw/ id name /],
59 [ 1, 'West' ],
60 [ 2, 'South' ],
61 [ 3, 'East' ],
62 [ 4, 'Midwest' ],
63 ]
64 );
65  
66 # Teams
67 1 my @teams = $schema->populate(
68 'Team',
69 [
70 [qw/ id seed name region /],
71 [ 1, 1, 'Gonzaga', 1 ],
72 [ 2, 16, "Georgia St", 1 ],
73 [ 3, 8, 'Boise St', 1 ],
74 [ 4, 9, 'Memphis', 1 ],
75 [ 5, 5, 'UConn', 1 ],
76 [ 6, 12, 'New Mexico St', 1 ],
77 [ 7, 4, 'Arkansas', 1 ],
78 [ 8, 13, 'Vermont', 1 ],
79 [ 9, 6, 'Alabama', 1 ],
80 [ 10, 11, 'Rutg/ND', 1 ],
81 [ 11, 3, 'Texas Tech', 1 ],
82 [ 12, 14, 'Montana St', 1 ],
83 [ 13, 7, 'Michigan St', 1 ],
84 [ 14, 10, 'Davidson', 1 ],
85 [ 15, 2, 'Duke', 1 ],
86 [ 16, 15, 'Fullerton', 1 ],
87  
88 [ 17, 1, 'Arizona', 2 ],
89 [ 18, 16, 'WRST/BRY', 2 ],
90 [ 19, 8, 'Seton Hall', 2 ],
91 [ 20, 9, 'TCU', 2 ],
92 [ 21, 5, 'Houston', 2 ],
93 [ 22, 12, 'UAB', 2 ],
94 [ 23, 4, 'Illinois', 2 ],
95 [ 24, 13, 'Chattanooga', 2 ],
96 [ 25, 6, 'Colorado St', 2 ],
97 [ 26, 11, 'Michigan', 2 ],
98 [ 27, 3, 'Tennessee', 2 ],
99 [ 28, 14, 'Longwood', 2 ],
100 [ 29, 7, "Ohio St", 2 ],
101 [ 30, 10, 'Loyola Chicago', 2 ],
102 [ 31, 2, 'Villanova', 2 ],
103 [ 32, 15, 'Delaware', 2 ],
104  
105 [ 33, 1, 'Baylor', 3 ],
106 [ 34, 16, 'Norfolk St', 3 ],
107 [ 35, 8, 'North Carolina', 3 ],
108 [ 36, 9, 'Marquette', 3 ],
109 [ 37, 5, 'Saint Mary', 3 ],
110 [ 38, 12, 'Indiana', 3 ],
111 [ 39, 4, 'UCLA', 3 ],
112 [ 40, 13, 'Akron', 3 ],
113 [ 41, 6, 'Texas', 3 ],
114 [ 42, 11, 'Virginia Tech', 3 ],
115 [ 43, 3, 'Purdue', 3 ],
116 [ 44, 14, 'Yale', 3 ],
117 [ 45, 7, 'Murray St', 3 ],
118 [ 46, 10, 'San Francisco', 3 ],
119 [ 47, 2, 'Kentucky', 3 ],
120 [ 48, 15, 'Saint Peter', 3 ],
121  
122 [ 49, 1, 'Kansas', 4 ],
123 [ 50, 16, 'Texas Southern', 4 ],
124 [ 51, 8, 'San Diego St', 4 ],
125 [ 52, 9, 'Creighton', 4 ],
126 [ 53, 5, 'Iowa', 4 ],
127 [ 54, 12, 'Richmond', 4 ],
128 [ 55, 4, 'Providence', 4 ],
129 [ 56, 13, 'S Dakota St', 4 ],
130 [ 57, 6, 'LSU', 4 ],
131 [ 58, 11, 'Iowa St', 4 ],
132 [ 59, 3, 'Wisconsin', 4 ],
133 [ 60, 14, 'Colgate', 4 ],
134 [ 61, 7, 'USC', 4 ],
135 [ 62, 10, 'Miami', 4 ],
136 [ 63, 2, 'Auburn', 4 ],
137 [ 64, 15, 'Jacksonville St', 4 ],
138 ]
139 );
140  
141 # Games
142 1 my @games = $schema->populate(
143 'Game',
144 [
145 [qw/ id round /],
146 [ 1, 1 ],
147 [ 2, 1 ],
148 [ 3, 1 ],
149 [ 4, 1 ],
150 [ 5, 1 ],
151 [ 6, 1 ],
152 [ 7, 1 ],
153 [ 8, 1 ],
154 [ 9, 2 ],
155 [ 10, 2 ],
156 [ 11, 2 ],
157 [ 12, 2 ],
158 [ 13, 3 ],
159 [ 14, 3 ],
160 [ 15, 4 ],
161 [ 16, 1 ],
162 [ 17, 1 ],
163 [ 18, 1 ],
164 [ 19, 1 ],
165 [ 20, 1 ],
166 [ 21, 1 ],
167 [ 22, 1 ],
168 [ 23, 1 ],
169 [ 24, 2 ],
170 [ 25, 2 ],
171 [ 26, 2 ],
172 [ 27, 2 ],
173 [ 28, 3 ],
174 [ 29, 3 ],
175 [ 30, 4 ],
176 [ 31, 1 ],
177 [ 32, 1 ],
178 [ 33, 1 ],
179 [ 34, 1 ],
180 [ 35, 1 ],
181 [ 36, 1 ],
182 [ 37, 1 ],
183 [ 38, 1 ],
184 [ 39, 2 ],
185 [ 40, 2 ],
186 [ 41, 2 ],
187 [ 42, 2 ],
188 [ 43, 3 ],
189 [ 44, 3 ],
190 [ 45, 4 ],
191 [ 46, 1 ],
192 [ 47, 1 ],
193 [ 48, 1 ],
194 [ 49, 1 ],
195 [ 50, 1 ],
196 [ 51, 1 ],
197 [ 52, 1 ],
198 [ 53, 1 ],
199 [ 54, 2 ],
200 [ 55, 2 ],
201 [ 56, 2 ],
202 [ 57, 2 ],
203 [ 58, 3 ],
204 [ 59, 3 ],
205 [ 60, 4 ],
206 [ 61, 5 ],
207 [ 62, 5 ],
208 [ 63, 6 ],
209 ]
210 );
211 }
212  
213 4 1
214  
215 __END__
« script/deploy_new_year_bracket.pl ↑ Summary lib/Bracket/Form/Register.pm »