trabajo-afectivo/lib/import/transaction_factory.rb

19 lines
381 B
Ruby
Raw Normal View History

module Import
module TransactionFactory
include Import::BaseFactory
# rubocop:disable Style/ModuleFunction
extend self
def import(records)
ActiveRecord::Base.transaction do
pre_import_hook(records)
records.each do |record|
next if skip?(record)
backend_class(record).new(record)
end
end
end
end
end