class Creature < ApplicationRecord scope :alive, -> { where('health_points > 0') } enum :size, [:small, :big, :giant] def to_label "#{name} (#{health_points})" end end