1
0
Fork 0

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:
Andrew Tomaka 2015-11-03 15:31:05 -05:00
commit c0bd723e31
2 changed files with 7 additions and 2 deletions

View file

@ -3,4 +3,6 @@ class LeaderSkill < ActiveRecord::Base
validates :description, presence: true,
uniqueness: { case_sensitive: false }
default_scope { order(:description) }
end

View file

@ -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