Skip to content

Commit

Permalink
feat!: rename impl_class to with_advisory_impl_class
Browse files Browse the repository at this point in the history
fixes #83
  • Loading branch information
seuros committed Mar 3, 2024
1 parent e50450e commit 2e1b953
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/with_advisory_lock/concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def with_advisory_lock!(lock_name, options = {}, &block)
end

def with_advisory_lock_result(lock_name, options = {}, &block)
impl = impl_class.new(connection, lock_name, options)
impl = with_advisory_lock_impl_class.new(connection, lock_name, options)
impl.with_advisory_lock_if_needed(&block)
end

def advisory_lock_exists?(lock_name)
impl = impl_class.new(connection, lock_name, 0)
impl = with_advisory_lock_impl_class.new(connection, lock_name, 0)
impl.already_locked? || !impl.yield_with_lock.lock_was_acquired?
end

Expand All @@ -35,7 +35,7 @@ def current_advisory_lock

private

def impl_class
def with_advisory_lock_impl_class
adapter = WithAdvisoryLock::DatabaseAdapterSupport.new(connection)
if adapter.postgresql?
WithAdvisoryLock::PostgreSQL
Expand Down

0 comments on commit 2e1b953

Please sign in to comment.