Sha256: 99d670306ba4565387ec7f626b8bd863fd6999d5fca9e357ce155261d5e5f67d

Contents?: true

Size: 550 Bytes

Versions: 28

Compression:

Stored size: 550 Bytes

Contents

module Imports
  module Rollback  
    def rollback_orders
      Order.where(:import_id => self.id).where(:organization_id => self.organization.id).all.each {|o| o.destroy(:with_prejudice => true)}
    end
  
    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
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.7 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.6 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.5 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.4 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.3 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.2 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.1 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre app/models/imports/rollback.rb