class Creature < ApplicationRecord scope :alive, -> { where('health_points > 0') } def to_label "#{name} (#{health_points})" end end