diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-13 10:05:57 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-13 10:05:57 -0400 |
| commit | a1a5cb52277d45be323528159addab7971e585a5 (patch) | |
| tree | 5207ba1f6a60b3a07b820ac00a65b5a9bc272bea /app | |
| parent | 44a0c2e75ef577e6e847cbeb940ea936904c9d72 (diff) | |
| download | pokeviewer-a1a5cb52277d45be323528159addab7971e585a5.tar.gz pokeviewer-a1a5cb52277d45be323528159addab7971e585a5.tar.bz2 pokeviewer-a1a5cb52277d45be323528159addab7971e585a5.zip | |
Fixed behavior of gift ribbons for Pokémon not in any game
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/pokeviewer/pokemon.rb | 8 | ||||
| -rw-r--r-- | app/models/pokeviewer/revision.rb | 14 |
2 files changed, 15 insertions, 7 deletions
| diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index ab516fb..f65d68e 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb | |||
| @@ -186,6 +186,14 @@ module Pokeviewer | |||
| 186 | end | 186 | end |
| 187 | end | 187 | end |
| 188 | 188 | ||
| 189 | def gift_ribbon_description(ribbon) | ||
| 190 | if trainer.nil? | ||
| 191 | "" | ||
| 192 | else | ||
| 193 | trainer.gift_ribbon_description(ribbon) | ||
| 194 | end | ||
| 195 | end | ||
| 196 | |||
| 189 | private | 197 | private |
| 190 | 198 | ||
| 191 | def set_uuid | 199 | def set_uuid |
| diff --git a/app/models/pokeviewer/revision.rb b/app/models/pokeviewer/revision.rb index 2626ae3..e33ac4f 100644 --- a/app/models/pokeviewer/revision.rb +++ b/app/models/pokeviewer/revision.rb | |||
| @@ -363,7 +363,7 @@ module Pokeviewer | |||
| 363 | result << { | 363 | result << { |
| 364 | filename: "marine-ribbon.png", | 364 | filename: "marine-ribbon.png", |
| 365 | name: "Marine Ribbon", | 365 | name: "Marine Ribbon", |
| 366 | description: pokemon.trainer.gift_ribbon_description(:marine_ribbon) | 366 | description: pokemon.gift_ribbon_description(:marine_ribbon) |
| 367 | } | 367 | } |
| 368 | end | 368 | end |
| 369 | 369 | ||
| @@ -371,7 +371,7 @@ module Pokeviewer | |||
| 371 | result << { | 371 | result << { |
| 372 | filename: "land-ribbon.png", | 372 | filename: "land-ribbon.png", |
| 373 | name: "Land Ribbon", | 373 | name: "Land Ribbon", |
| 374 | description: pokemon.trainer.gift_ribbon_description(:land_ribbon) | 374 | description: pokemon.gift_ribbon_description(:land_ribbon) |
| 375 | } | 375 | } |
| 376 | end | 376 | end |
| 377 | 377 | ||
| @@ -379,7 +379,7 @@ module Pokeviewer | |||
| 379 | result << { | 379 | result << { |
| 380 | filename: "sky-ribbon.png", | 380 | filename: "sky-ribbon.png", |
| 381 | name: "Sky Ribbon", | 381 | name: "Sky Ribbon", |
| 382 | description: pokemon.trainer.gift_ribbon_description(:sky_ribbon) | 382 | description: pokemon.gift_ribbon_description(:sky_ribbon) |
| 383 | } | 383 | } |
| 384 | end | 384 | end |
| 385 | 385 | ||
| @@ -387,7 +387,7 @@ module Pokeviewer | |||
| 387 | result << { | 387 | result << { |
| 388 | filename: "country-ribbon.png", | 388 | filename: "country-ribbon.png", |
| 389 | name: "Country Ribbon", | 389 | name: "Country Ribbon", |
| 390 | description: pokemon.trainer.gift_ribbon_description(:country_ribbon) | 390 | description: pokemon.gift_ribbon_description(:country_ribbon) |
| 391 | } | 391 | } |
| 392 | end | 392 | end |
| 393 | 393 | ||
| @@ -395,7 +395,7 @@ module Pokeviewer | |||
| 395 | result << { | 395 | result << { |
| 396 | filename: "national-ribbon.png", | 396 | filename: "national-ribbon.png", |
| 397 | name: "National Ribbon", | 397 | name: "National Ribbon", |
| 398 | description: pokemon.trainer.gift_ribbon_description(:national_ribbon) | 398 | description: pokemon.gift_ribbon_description(:national_ribbon) |
| 399 | } | 399 | } |
| 400 | end | 400 | end |
| 401 | 401 | ||
| @@ -403,7 +403,7 @@ module Pokeviewer | |||
| 403 | result << { | 403 | result << { |
| 404 | filename: "earth-ribbon.png", | 404 | filename: "earth-ribbon.png", |
| 405 | name: "Earth Ribbon", | 405 | name: "Earth Ribbon", |
| 406 | description: pokemon.trainer.gift_ribbon_description(:earth_ribbon) | 406 | description: pokemon.gift_ribbon_description(:earth_ribbon) |
| 407 | } | 407 | } |
| 408 | end | 408 | end |
| 409 | 409 | ||
| @@ -411,7 +411,7 @@ module Pokeviewer | |||
| 411 | result << { | 411 | result << { |
| 412 | filename: "world-ribbon.png", | 412 | filename: "world-ribbon.png", |
| 413 | name: "World Ribbon", | 413 | name: "World Ribbon", |
| 414 | description: pokemon.trainer.gift_ribbon_description(:world_ribbon) | 414 | description: pokemon.gift_ribbon_description(:world_ribbon) |
| 415 | } | 415 | } |
| 416 | end | 416 | end |
| 417 | 417 | ||
