diff --git a/app/models/platform_communicate.rb b/app/models/platform_communicate.rb index a8673756..8ce7512a 100644 --- a/app/models/platform_communicate.rb +++ b/app/models/platform_communicate.rb @@ -21,11 +21,11 @@ class PlatformCommunicate < ApplicationRecord has_many :watchers, as: :watchable, dependent: :destroy def watched_ext_info(user_id) - ext_info = self.watchers.find_by(user_id: user_id) - return [] if ext_info.blank? + watcher = self.watchers.find_by(user_id: user_id) + return [] if watcher.blank? str = [] self.enroll_field.to_s.split(",").each_with_index do |m, index| - str.push("#{ext_info["ext#{index + 1}"]}") + str.push("#{watcher.ext_info["ext#{index + 1}"]}") end str end