Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override equality operator for activerecord connection wrapper #269

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def custom_error_message?(connection, message)
send_to_all :connect, :reconnect!, :verify!, :clear_cache!, :reset!

control_method :close, :steal!, :expire, :lease, :in_use?, :owner, :schema_cache, :pool=, :pool,
:schema_cache=, :lock, :seconds_idle
:schema_cache=, :lock, :seconds_idle, :==


SQL_MASTER_MATCHERS = [/\A\s*select.+for update\Z/i, /select.+lock in share mode\Z/i, /\A\s*select.+(nextval|currval|lastval|get_lock|release_lock|pg_advisory_lock|pg_advisory_unlock)\(/i].map(&:freeze).freeze
Expand Down Expand Up @@ -307,6 +307,10 @@ def pool=(*args)
def pool(*args)
@pool
end

def ==(*args)
@proxy.object_id == args[0].object_id
end
end
end
end
Expand Down