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 app/models/imports/rollback.rb
artfully_ose-1.2.0.beta.1 app/models/imports/rollback.rb
artfully_ose-1.2.0.alpha.2 app/models/imports/rollback.rb
artfully_ose-1.2.0.alpha.1 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.27 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.26 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.24 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.23 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.21 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.20 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.19 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.18 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.17 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.16 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.15 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.12 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.11 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.10 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.9 app/models/imports/rollback.rb
artfully_ose-1.2.0.pre.8 app/models/imports/rollback.rb