Module: DestroySoon::ModelAdditions

Extended by:
ActiveSupport::Concern
Defined in:
lib/destroy_soon/model_additions.rb

Instance Method Summary collapse

Instance Method Details

#async_destroyObject



9
10
11
12
13
14
15
# File 'lib/destroy_soon/model_additions.rb', line 9

def async_destroy
  unless self.destroy_soon
    self.update_attribute(:destroy_soon, true)

    DestroySoon::Queue.new.enqueue DestroySoon::Job.new(:entity => self)
  end
end