1
0
Fork 0

Allow unnamed passive skills

This commit is contained in:
Andrew Tomaka 2015-11-03 15:29:10 -05:00
parent 8bef784209
commit cd7e8f736f

View file

@ -1,13 +1,16 @@
class PassiveSkill < ActiveRecord::Base
has_paper_trail
validates :name, presence: true
validates :description, presence: true,
uniqueness: { scope: :name }
default_scope { order(:name) }
def full
"#{name} - #{description}"
"#{display_name} - #{description}"
end
def display_name
name.present? ? name : 'UNNAMED'
end
end