blob: 4096e8ed57854b4cdce0307cb9be779411dd2087 (
plain)
1
2
3
4
5
6
7
|
class MonsterKill < ApplicationRecord
belongs_to :monster
belongs_to :character
validates :quantity, numericality: { greater_than_or_equal_to: 0, only_integer: true }
scope :ordered_by_monster_name, -> { includes(:monster).order("monsters.name") }
end
|