2015-10-06 13:55:12 -04:00
|
|
|
class PassiveSkill < ActiveRecord::Base
|
2015-10-09 16:45:53 -04:00
|
|
|
has_paper_trail
|
|
|
|
|
2015-10-23 11:27:15 -04:00
|
|
|
validates :description, presence: true,
|
|
|
|
uniqueness: { scope: :name }
|
2015-10-08 13:08:45 -04:00
|
|
|
|
|
|
|
default_scope { order(:name) }
|
2015-10-23 13:41:19 -04:00
|
|
|
|
|
|
|
def full
|
2015-11-03 15:29:10 -05:00
|
|
|
"#{display_name} - #{description}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def display_name
|
|
|
|
name.present? ? name : 'UNNAMED'
|
2015-10-23 13:41:19 -04:00
|
|
|
end
|
2015-11-03 16:15:20 -05:00
|
|
|
|
|
|
|
def self.issues
|
|
|
|
PassiveSkill.where("name = '' OR description = ''")
|
|
|
|
end
|
2015-10-06 13:55:12 -04:00
|
|
|
end
|