class PlayerCard < ActiveRecord::Base belongs_to :player belongs_to :play, optional: true def to_s # TODO: Shouldn't hard code face cards here [rank, suit].join(' ') .gsub('11','J') .gsub('12','Q') .gsub('13','K') .gsub('14','A') .gsub('15','2') end end