Sha256: 7c4b9400e6791ba93db1a950810cc2fedf66768028471b2d8799af7db69e3055

Contents?: true

Size: 289 Bytes

Versions: 25

Compression:

Stored size: 289 Bytes

Contents

class DeletedItem < ActiveRecord::Base

  def self.save_and_destroy(item, deleted_by)
    DeletedItem.create(
      item_type: item.class.to_s,
      item_id: item.id,
      yaml: item.to_yaml,
      json: item.to_json,
      deleted_by_id: deleted_by.id
    )

    item.destroy
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
tawork-0.0.50 app/models/deleted_item.rb
tawork-0.0.49 app/models/deleted_item.rb
tawork-0.0.48 app/models/deleted_item.rb
tawork-0.0.47 app/models/deleted_item.rb
tawork-0.0.46 app/models/deleted_item.rb
tawork-0.0.45 app/models/deleted_item.rb
tawork-0.0.44 app/models/deleted_item.rb
tawork-0.0.43 app/models/deleted_item.rb
tawork-0.0.42 app/models/deleted_item.rb
tawork-0.0.41 app/models/deleted_item.rb
tawork-0.0.40 app/models/deleted_item.rb
tawork-0.0.39 app/models/deleted_item.rb
tawork-0.0.38 app/models/deleted_item.rb
tawork-0.0.37 app/models/deleted_item.rb
tawork-0.0.36 app/models/deleted_item.rb
tawork-0.0.35 app/models/deleted_item.rb
tawork-0.0.34 app/models/deleted_item.rb
tawork-0.0.33 app/models/deleted_item.rb
tawork-0.0.31 app/models/deleted_item.rb
tawork-0.0.30 app/models/deleted_item.rb