blob: ec9ff9f6adc81c1fad2c57293e32ce3f5afdfdde (
plain)
1
2
3
4
5
6
7
8
9
|
class Pokemon < ApplicationRecord
has_many :pokedex_entries, dependent: :restrict_with_error
validates :pokedex_num, :name, presence: true
def sprite_path(shiny: false)
"sprites/pokemon/#{"shiny/" if shiny}#{pokedex_num}.png"
end
end
|