diff --git a/lib/rss_ntu_job.rb b/lib/rss_ntu_job.rb index e22becff..ae68a2c4 100644 --- a/lib/rss_ntu_job.rb +++ b/lib/rss_ntu_job.rb @@ -128,12 +128,12 @@ all.each do |key, value| # Loop through all the authors main_bulletin = bulletin.clone main_bulletin['_id'] = BSON::ObjectId.new main_bulletin[:category_id] = category_id - main_bs = @main_coll_bulletin.save(main_bulletin) + @main_coll_bulletin.save(main_bulletin) main_buffer_cat = { _type: "BufferCategory", category_id: category_id, categorizable_type: "Bulletin", - categorizable_id: main_bs } + categorizable_id: main_bulletin['_id'] } @main_coll_buffer_cat.save(main_buffer_cat) category_id, @copy_categories = get_category_id(bul[:category], @copy_categories, @copy_coll_cat, @copy_bulletin_module_id) @@ -141,12 +141,11 @@ all.each do |key, value| # Loop through all the authors copy_bulletin['_id'] = BSON::ObjectId.new copy_bulletin[:category_id] = category_id @copy_coll_bulletin.save(copy_bulletin) - copy_bs = @copy_coll_bulletin.save(copy_bulletin) copy_buffer_cat = { _type: "BufferCategory", category_id: category_id, categorizable_type: "Bulletin", - categorizable_id: copy_bs } + categorizable_id: copy_bulletin['_id'] } @copy_coll_buffer_cat.save(copy_buffer_cat) end