You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
class Creature < ApplicationRecord
|
|
scope :alive, -> { where('health_points > 0') }
|
|
|
|
enum :size, [:small, :big, :giant]
|
|
|
|
def to_label
|
|
"#{name} (#{health_points})"
|
|
end
|
|
|
|
|
|
end
|