Module: Imports::Rollback

Included in:
DonationsImport, EventsImport, MembershipsImport
Defined in:
app/models/imports/rollback.rb

Instance Method Summary collapse

Instance Method Details

#rollback_ordersObject



3
4
5
# File 'app/models/imports/rollback.rb', line 3

def rollback_orders
  Order.where(:import_id => self.id).where(:organization_id => self.organization.id).all.each {|o| o.destroy(:with_prejudice => true)}
end

#rollback_peopleObject



7
8
9
10
11
12
13
14
# File 'app/models/imports/rollback.rb', line 7

def rollback_people 
  Rails.logger.debug "ROLLING BACK PEOPLE"
  Person.where(:import_id => self.id).where(:organization_id => self.organization.id).all.each do |p|
    Rails.logger.debug "Destroying [#{p.id}]"
    result = p.destroy(:with_prejudice => true)
    Rails.logger.debug result
  end
end