Update journal_papers_controller.rb
This commit is contained in:
parent
1d6e584c99
commit
240b91c36c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue