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|
|
params['journal_id'].each do |journal_id|
|
||||||
journal_ids = journal_id.split('/')
|
journal_ids = journal_id.split('/')
|
||||||
journals = JournalPaper.find(journal_ids)
|
journals = JournalPaper.find(journal_ids)
|
||||||
members = get_member(journals).uniq
|
member_ids = journals.collect(&:member_profile_id).uniq
|
||||||
puts journals[0]
|
journals.each_with_index do |journal,index1|
|
||||||
|
if index1== 0
|
||||||
|
journal.member_profile_id = member_ids
|
||||||
|
journal.save!
|
||||||
|
else
|
||||||
|
journal.delete
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
redirect_to :action=> 'index'
|
redirect_to :action=> 'index'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue