11
12
13
14
15
16
17
18
19
|
# File 'app/models/patron_merge_list.rb', line 11
def merge_patrons(selected_patron)
self.patrons.each do |patron|
Create.update_all(['patron_id = ?', selected_patron.id], ['patron_id = ?', patron.id])
Produce.update_all(['patron_id = ?', selected_patron.id], ['patron_id = ?', patron.id])
Own.update_all(['patron_id = ?', selected_patron.id], ['patron_id = ?', patron.id])
Donate.update_all(['patron_id = ?', selected_patron.id], ['patron_id = ?', patron.id])
patron.destroy unless patron == selected_patron
end
end
|