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

18 lines
331 B
Ruby

# frozen_string_literal: true
class MergeContactLists
include Interactor
after do
context.from.contacts.reload
context.to.contacts.reload
end
def call
ActiveRecord::Base.transaction do
context.from.contacts.each do |contact|
contact.update! contact_list: context.to
end
end
end
end