From 65efc03be8b0426b42bb294bcfda72a1f7ccd189 Mon Sep 17 00:00:00 2001
From: Giovanne Marcelo <gms15@inf.ufpr.br>
Date: Fri, 26 Feb 2016 09:59:18 -0300
Subject: [PATCH] Fixing small bug

---
 app/services/topics_importer.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/services/topics_importer.rb b/app/services/topics_importer.rb
index e52248a6..0180f3e3 100644
--- a/app/services/topics_importer.rb
+++ b/app/services/topics_importer.rb
@@ -20,8 +20,11 @@ class TopicsImporter
 
         if !topic_exists? topic_name
           topic = Topic.where(name: topic_name).new
+        elsif @@topics[topic_name].nil?
+          topic = Topic.find_by_name topic_name
         end
 
+
         create_relations(topic_name)
         learning_object.topics << topic
         @@topics[topic_name] = topic
-- 
GitLab