fix rss_ntu_job buffer_category save issue

This commit is contained in:
Spen 2014-01-27 16:10:39 +08:00 committed by Manson Wang
parent d6b165cec6
commit ebca98cd85
1 changed files with 3 additions and 4 deletions

View File

@ -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