diff --git a/app/models/leader_skill.rb b/app/models/leader_skill.rb index 07c4d64..50dffb5 100644 --- a/app/models/leader_skill.rb +++ b/app/models/leader_skill.rb @@ -3,4 +3,6 @@ class LeaderSkill < ActiveRecord::Base validates :description, presence: true, uniqueness: { case_sensitive: false } + + default_scope { order(:description) } end diff --git a/app/models/passive_skill.rb b/app/models/passive_skill.rb index fa07c6f..dd1b956 100644 --- a/app/models/passive_skill.rb +++ b/app/models/passive_skill.rb @@ -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