module Babik::QuerySet::Lockable

Lock functionality of QuerySet

Public Instance Methods

for_update!() click to toggle source

Lock the table for writes This must be inside a transaction

# File lib/babik/queryset/mixins/lockable.rb, line 10
def for_update!
  @_lock_type = 'FOR UPDATE'
  self
end
lock!() click to toggle source

Lock the table for writes This must be inside a transaction @see for_update Alias of for_update method

# File lib/babik/queryset/mixins/lockable.rb, line 18
def lock!
  self.for_update!
end
lock?() click to toggle source

Check if there is a lock @return [Boolean] True if there is a lock, false otherwise.

# File lib/babik/queryset/mixins/lockable.rb, line 24
def lock?
  return true if @_lock_type
  false
end