diff --git a/app/models/concerns/project_media_creators.rb b/app/models/concerns/project_media_creators.rb index 6b4aeafc5..4262f0140 100644 --- a/app/models/concerns/project_media_creators.rb +++ b/app/models/concerns/project_media_creators.rb @@ -263,9 +263,6 @@ def create_claim_description_and_fact_check end def create_tags - # self.set_tags.each { |tag| Tag.create!(annotated: self, tag: tag.strip, skip_check_ability: true) } if self.set_tags.is_a?(Array) - # require 'byebug' - # byebug - self.set_tags.each { |tag| GenericWorker.perform_in(1.second, 'Tag', 'create!', annotated: self, tag: tag.strip, skip_check_ability: true) } if self.set_tags.is_a?(Array) + self.set_tags.each { |tag| GenericWorker.perform_in(1.second, 'Tag', 'create!', annotated_type: 'ProjectMedia' , annotated_id: self.id, tag: tag.strip, skip_check_ability: true) } if self.set_tags.is_a?(Array) end end diff --git a/test/workers/generic_worker_test.rb b/test/workers/generic_worker_test.rb index 9e75c9d96..94faa232d 100644 --- a/test/workers/generic_worker_test.rb +++ b/test/workers/generic_worker_test.rb @@ -14,7 +14,7 @@ def setup pm = create_project_media project: p assert_nothing_raised do - GenericWorker.perform_async('Tag', 'create!', annotated: pm, tag: 'test_tag', skip_check_ability: true) + GenericWorker.perform_async('Tag', 'create!', annotated_type: 'ProjectMedia' , annotated_id: pm.id, tag: 'test_tag', skip_check_ability: true) end end