Merge branch 'atomaka/feature/useful-things' into 'master'
Skill Useful Fixes * Add default sort order to the Leader Skill page * Remove passive skill name requirement. See merge request !19
This commit is contained in:
commit
c0bd723e31
2 changed files with 7 additions and 2 deletions
|
@ -3,4 +3,6 @@ class LeaderSkill < ActiveRecord::Base
|
||||||
|
|
||||||
validates :description, presence: true,
|
validates :description, presence: true,
|
||||||
uniqueness: { case_sensitive: false }
|
uniqueness: { case_sensitive: false }
|
||||||
|
|
||||||
|
default_scope { order(:description) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -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