1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/interactors/merge_contact_lists.rb

19 lines
383 B
Ruby
Raw Normal View History

2019-08-14 09:10:09 -04:00
# frozen_string_literal: true
class MergeContactLists
include Interactor
after do
2019-08-14 10:55:00 -04:00
context.old_contact_list.contacts.reload
context.new_contact_list.contacts.reload
2019-08-14 09:10:09 -04:00
end
def call
ActiveRecord::Base.transaction do
2019-08-14 10:55:00 -04:00
context.old_contact_list.contacts.each do |contact|
contact.update! contact_list: context.new_contact_list
2019-08-14 09:10:09 -04:00
end
end
end
end