Allow unnamed passive skills
This commit is contained in:
parent
8bef784209
commit
cd7e8f736f
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue