diff --git a/app/controllers/admin/journal_papers_controller.rb b/app/controllers/admin/journal_papers_controller.rb index 25b0d5d..9e9f8c5 100644 --- a/app/controllers/admin/journal_papers_controller.rb +++ b/app/controllers/admin/journal_papers_controller.rb @@ -13,8 +13,15 @@ class Admin::JournalPapersController < OrbitMemberController params['journal_id'].each do |journal_id| journal_ids = journal_id.split('/') journals = JournalPaper.find(journal_ids) - members = get_member(journals).uniq - puts journals[0] + member_ids = journals.collect(&:member_profile_id).uniq + journals.each_with_index do |journal,index1| + if index1== 0 + journal.member_profile_id = member_ids + journal.save! + else + journal.delete + end + end end redirect_to :action=> 'index' end