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,
|
||||
uniqueness: { case_sensitive: false }
|
||||
|
||||
default_scope { order(:description) }
|
||||
end
|
||||
|
|
|
@ -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