From 2cf7eeb90ad8e677c6cbd793b76c39bc38e931b0 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 26 May 2021 18:49:08 -0400 Subject: Fix bug where XP could go to the wrong character --- app/models/character.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models') 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 -- cgit v1.2.3