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
|
class PassiveSkill < ActiveRecord::Base
|
||||||
has_paper_trail
|
has_paper_trail
|
||||||
|
|
||||||
validates :name, presence: true
|
|
||||||
validates :description, presence: true,
|
validates :description, presence: true,
|
||||||
uniqueness: { scope: :name }
|
uniqueness: { scope: :name }
|
||||||
|
|
||||||
default_scope { order(:name) }
|
default_scope { order(:name) }
|
||||||
|
|
||||||
def full
|
def full
|
||||||
"#{name} - #{description}"
|
"#{display_name} - #{description}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_name
|
||||||
|
name.present? ? name : 'UNNAMED'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue