Sha256: 9df4267475cd7882f63db75398f503c6bcd7f88f302806fd2183a178b397f946

Contents?: true

Size: 472 Bytes

Versions: 9

Compression:

Stored size: 472 Bytes

Contents

module Spontaneous::Model::Core
  # Ensure that any page locks belonging to content items are destroyed along
  # with the content.
  #
  # This has to be separate from any page-level deletion because the locks are
  # owned by both and deleting the contents of a box should release locks
  # belonging to them.
  module Locks
    extend Spontaneous::Concern

    def after_destroy
      Spontaneous::PageLock.where(:content_id => id).delete
      super
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta9 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta8 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta7 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta6 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta5 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta4 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta3 lib/spontaneous/model/core/locks.rb
spontaneous-0.2.0.beta2 lib/spontaneous/model/core/locks.rb