diff options
author | David Gay <david@davidgay.org> | 2021-05-26 18:49:08 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-26 18:49:08 -0400 |
commit | 2cf7eeb90ad8e677c6cbd793b76c39bc38e931b0 (patch) | |
tree | 9e81451b463fd29650dcb034f4b3556b31edb6d6 /app/models | |
parent | 97c076b3c489c0dc81c7c3bb9ceddd35a86c01c5 (diff) |
Fix bug where XP could go to the wrong character
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/character.rb b/app/models/character.rb index c0f785f..52c0959 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -96,7 +96,7 @@ class Character < ApplicationRecord def add_skill_xp(skill, amount) skill = Skill.find_by_gid(skill) if skill.is_a? String Character.transaction do - cs = CharacterSkill.find_by(skill: skill) + cs = self.character_skills.find_by(skill: skill) cs.xp += amount cs.save! end |