Skip to content

Commit

Permalink
Fix: User may sometimes pass in non-strings, such as integers (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrdwdmrbl committed Jul 30, 2022
1 parent 514f042 commit 9885597
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/with_advisory_lock/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def release_lock
end

def execute_successful?(pg_function)
comment = lock_name.gsub(/(\/\*)|(\*\/)/, '--')
comment = lock_name.to_s.gsub(/(\/\*)|(\*\/)/, '--')
sql = "SELECT #{pg_function}(#{lock_keys.join(',')}) AS #{unique_column_name} /* #{comment} */"
result = connection.select_value(sql)
# MRI returns 't', jruby returns true. YAY!
Expand Down

0 comments on commit 9885597

Please sign in to comment.