about summary refs log tree commit diff stats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pokeviewer/revision.rb298
1 files changed, 297 insertions, 1 deletions
diff --git a/app/models/pokeviewer/revision.rb b/app/models/pokeviewer/revision.rb index 44388ca..4481bf0 100644 --- a/app/models/pokeviewer/revision.rb +++ b/app/models/pokeviewer/revision.rb
@@ -8,7 +8,11 @@ module Pokeviewer
8 :special_attack, :special_defense, :speed, :coolness, :beauty, :cuteness, 8 :special_attack, :special_defense, :speed, :coolness, :beauty, :cuteness,
9 :smartness, :toughness, :sheen, :hold_item, :move_1_id, :move_2_id, 9 :smartness, :toughness, :sheen, :hold_item, :move_1_id, :move_2_id,
10 :move_3_id, :move_4_id, :move_1_pp_bonuses, :move_2_pp_bonuses, 10 :move_3_id, :move_4_id, :move_1_pp_bonuses, :move_2_pp_bonuses,
11 :move_3_pp_bonuses, :move_4_pp_bonuses 11 :move_3_pp_bonuses, :move_4_pp_bonuses, :cool_ribbons, :beauty_ribbons,
12 :cute_ribbons, :smart_ribbons, :tough_ribbons, :champion_ribbon,
13 :winning_ribbon, :victory_ribbon, :artist_ribbon, :effort_ribbon,
14 :marine_ribbon, :land_ribbon, :sky_ribbon, :country_ribbon,
15 :national_ribbon, :earth_ribbon, :world_ribbon
12 16
13 belongs_to :pokemon 17 belongs_to :pokemon
14 acts_as_sequenced scope: :pokemon_id 18 acts_as_sequenced scope: :pokemon_id
@@ -103,5 +107,297 @@ module Pokeviewer
103 greater_than_or_equal_to: 0, 107 greater_than_or_equal_to: 0,
104 less_than_or_equal_to: 3, 108 less_than_or_equal_to: 3,
105 only_integer: true} 109 only_integer: true}
110
111 validates :cool_ribbons, presence: true,
112 numericality: {
113 greater_than_or_equal_to: 0,
114 less_than_or_equal_to: 4,
115 only_integer: true}
116
117 validates :beauty_ribbons, presence: true,
118 numericality: {
119 greater_than_or_equal_to: 0,
120 less_than_or_equal_to: 4,
121 only_integer: true}
122
123 validates :cute_ribbons, presence: true,
124 numericality: {
125 greater_than_or_equal_to: 0,
126 less_than_or_equal_to: 4,
127 only_integer: true}
128
129 validates :smart_ribbons, presence: true,
130 numericality: {
131 greater_than_or_equal_to: 0,
132 less_than_or_equal_to: 4,
133 only_integer: true}
134
135 validates :tough_ribbons, presence: true,
136 numericality: {
137 greater_than_or_equal_to: 0,
138 less_than_or_equal_to: 4,
139 only_integer: true}
140
141 def ribbons
142 result = []
143
144 if cool_ribbons >= 1
145 result << {
146 filename: "cool-ribbon.png",
147 name: "Cool Ribbon",
148 description: "Cool Contest Normal Rank Winner!"
149 }
150 end
151
152 if cool_ribbons >= 2
153 result << {
154 filename: "cool-ribbon-super.png",
155 name: "Cool Ribbon Super",
156 description: "Cool Contest Super Rank Winner!"
157 }
158 end
159
160 if cool_ribbons >= 3
161 result << {
162 filename: "cool-ribbon-hyper.png",
163 name: "Cool Ribbon Hyper",
164 description: "Cool Contest Hyper Rank Winner!"
165 }
166 end
167
168 if cool_ribbons == 4
169 result << {
170 filename: "cool-ribbon-master.png",
171 name: "Cool Ribbon Master",
172 description: "Cool Contest Master Rank Winner!"
173 }
174 end
175
176 if beauty_ribbons >= 1
177 result << {
178 filename: "beauty-ribbon.png",
179 name: "Beauty Ribbon",
180 description: "Beauty Contest Normal Rank Winner!"
181 }
182 end
183
184 if beauty_ribbons >= 2
185 result << {
186 filename: "beauty-ribbon-super.png",
187 name: "Beauty Ribbon Super",
188 description: "Beauty Contest Super Rank Winner!"
189 }
190 end
191
192 if beauty_ribbons >= 3
193 result << {
194 filename: "beauty-ribbon-hyper.png",
195 name: "Beauty Ribbon Hyper",
196 description: "Beauty Contest Hyper Rank Winner!"
197 }
198 end
199
200 if beauty_ribbons == 4
201 result << {
202 filename: "beauty-ribbon-master.png",
203 name: "Beauty Ribbon Master",
204 description: "Beauty Contest Master Rank Winner!"
205 }
206 end
207
208 if cute_ribbons >= 1
209 result << {
210 filename: "cute-ribbon.png",
211 name: "Cute Ribbon",
212 description: "Cute Contest Normal Rank Winner!"
213 }
214 end
215
216 if cute_ribbons >= 2
217 result << {
218 filename: "cute-ribbon-super.png",
219 name: "Cute Ribbon Super",
220 description: "Cute Contest Super Rank Winner!"
221 }
222 end
223
224 if cute_ribbons >= 3
225 result << {
226 filename: "cute-ribbon-hyper.png",
227 name: "Cute Ribbon Hyper",
228 description: "Cute Contest Hyper Rank Winner!"
229 }
230 end
231
232 if cute_ribbons == 4
233 result << {
234 filename: "cute-ribbon-master.png",
235 name: "Cute Ribbon Master",
236 description: "Cute Contest Master Rank Winner!"
237 }
238 end
239
240 if smart_ribbons >= 1
241 result << {
242 filename: "smart-ribbon.png",
243 name: "Smart Ribbon",
244 description: "Smart Contest Normal Rank Winner!"
245 }
246 end
247
248 if smart_ribbons >= 2
249 result << {
250 filename: "smart-ribbon-super.png",
251 name: "Smart Ribbon Super",
252 description: "Smart Contest Super Rank Winner!"
253 }
254 end
255
256 if smart_ribbons >= 3
257 result << {
258 filename: "smart-ribbon-hyper.png",
259 name: "Smart Ribbon Hyper",
260 description: "Smart Contest Hyper Rank Winner!"
261 }
262 end
263
264 if smart_ribbons == 4
265 result << {
266 filename: "smart-ribbon-master.png",
267 name: "Smart Ribbon Master",
268 description: "Smart Contest Master Rank Winner!"
269 }
270 end
271
272 if tough_ribbons >= 1
273 result << {
274 filename: "tough-ribbon.png",
275 name: "Tough Ribbon",
276 description: "Tough Contest Normal Rank Winner!"
277 }
278 end
279
280 if tough_ribbons >= 2
281 result << {
282 filename: "tough-ribbon-super.png",
283 name: "Tough Ribbon Super",
284 description: "Tough Contest Super Rank Winner!"
285 }
286 end
287
288 if tough_ribbons >= 3
289 result << {
290 filename: "tough-ribbon-hyper.png",
291 name: "Tough Ribbon Hyper",
292 description: "Tough Contest Hyper Rank Winner!"
293 }
294 end
295
296 if tough_ribbons == 4
297 result << {
298 filename: "tough-ribbon-master.png",
299 name: "Tough Ribbon Master",
300 description: "Tough Contest Master Rank Winner!"
301 }
302 end
303
304 if champion_ribbon
305 result << {
306 filename: "champion-ribbon.png",
307 name: "Champion Ribbon",
308 description: "Champion-beating, Hall of Fame Member Ribbon"
309 }
310 end
311
312 if winning_ribbon
313 result << {
314 filename: "winning-ribbon.png",
315 name: "Winning Ribbon",
316 description: "Ribbon for clearing LV50 at the Battle Tower."
317 }
318 end
319
320 if victory_ribbon
321 result << {
322 filename: "victory-ribbon.png",
323 name: "Victory Ribbon",
324 description: "Won for clearing LV100 at the Battle Tower."
325 }
326 end
327
328 if artist_ribbon
329 result << {
330 filename: "artist-ribbon.png",
331 name: "Artist Ribbon",
332 description: "Ribbon for being chosen as a super sketch model."
333 }
334 end
335
336 if effort_ribbon
337 result << {
338 filename: "effort-ribbon.png",
339 name: "Effort Ribbon",
340 description: "Ribbon awarded for being a hard worker."
341 }
342 end
343
344 if marine_ribbon
345 result << {
346 filename: "marine-ribbon.png",
347 name: "Marine Ribbon",
348 description: ""
349 }
350 end
351
352 if land_ribbon
353 result << {
354 filename: "land-ribbon.png",
355 name: "Land Ribbon",
356 description: ""
357 }
358 end
359
360 if sky_ribbon
361 result << {
362 filename: "sky-ribbon.png",
363 name: "Sky Ribbon",
364 description: ""
365 }
366 end
367
368 if country_ribbon
369 result << {
370 filename: "country-ribbon.png",
371 name: "Country Ribbon",
372 description: ""
373 }
374 end
375
376 if national_ribbon
377 result << {
378 filename: "national-ribbon.png",
379 name: "National Ribbon",
380 description: ""
381 }
382 end
383
384 if earth_ribbon
385 result << {
386 filename: "earth-ribbon.png",
387 name: "Earth Ribbon",
388 description: ""
389 }
390 end
391
392 if world_ribbon
393 result << {
394 filename: "world-ribbon.png",
395 name: "World Ribbon",
396 description: ""
397 }
398 end
399
400 result
401 end
106 end 402 end
107end 403end