Class: ActiveRecord::ConnectionAdapters::SQLiteAdapter

Inherits:
AbstractAdapter
  • Object
show all
Defined in:
lib/vex/active_record/advisory_lock/sqlite_adapter.rb

Instance Method Summary collapse

Instance Method Details

#locked(lock, opts = {}, &block) ⇒ Object



3
4
5
6
7
8
# File 'lib/vex/active_record/advisory_lock/sqlite_adapter.rb', line 3

def locked(lock, opts = {}, &block)
  database = instance_variable_get("@config")[:database]
  return yield if database == ":memory:"

  File.locked("#{database}.#{lock}", &block)
end