class Equipment < ApplicationRecord belongs_to :character belongs_to :item enum slot: [:mainhand, :offhand, :head, :neck, :back, :torso, :grip, :left_ring, :right_ring, :waist, :legs, :feet, :curio] validates :slot, presence: true, uniqueness: { scope: :character } def slot self[:slot].to_sym end end