diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character_skill.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/character_skill.rb b/app/models/character_skill.rb index 84c538e..368cc28 100644 --- a/app/models/character_skill.rb +++ b/app/models/character_skill.rb @@ -74,8 +74,9 @@ class CharacterSkill < ApplicationRecord end def award_titles - if CharacterSkill.level_for_xp(self.xp_was) < CharacterSkill.level_for_xp(xp) - if character.character_skills.to_a.sum(&:level) >= 100 + new_level = CharacterSkill.level_for_xp(xp) + if CharacterSkill.level_for_xp(self.xp_was) < new_level + if character.character_skills.where.not(id: self.id).to_a.sum(&:level) + new_level >= 100 character.award_title("aspirant") end end |