Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ straightforward as possible.
### Fixed

### Security


## [1.2.0] - 2025-08-28

Rails 7.2 support

## [1.1.0] - 2020-06-14

Executes any SQL statement with comments.
Expand Down
2 changes: 1 addition & 1 deletion lib/pgpool_no_load_balance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module PgpoolNoLoadBalance
class PostgreSQLAdapterMissing < StandardError; end

def self.setup!
unless ::ActiveRecord::Base.respond_to?(:postgresql_connection)
unless defined?(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
raise PostgreSQLAdapterMissing, "No postgresql adapter specified by 'config/database.yml', or 'ActiveRecord::Base.establish_connection' method is not called."
end
::ActiveRecord::Base.extend PgpoolNoLoadBalance::ActiveRecord::Querying
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def execute(sql, name = nil, pgpool_nlb: false)

private

def to_sql_and_binds(arel_or_sql_string, binds = [], preparable = nil) # :nodoc:
sql, binds, preparable = super
def to_sql_and_binds(arel_or_sql_string, binds = [], preparable = nil, allow_retry = false) # :nodoc:
sql, binds, preparable, allow_retry = super
if arel_or_sql_string.respond_to?(:pgpool_nlb?) && arel_or_sql_string.pgpool_nlb?
sql = "#{NLB_COMMENT} #{sql}"
end
[sql.freeze, binds, preparable]
[sql.freeze, binds, preparable, allow_retry]
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def pgpool_nlb_value
end

def pgpool_nlb_value=(value)
assert_mutability!
@values[:pgpool_nlb] = value
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pgpool_no_load_balance/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PgpoolNoLoadBalance
VERSION = "1.1.0"
VERSION = "1.2.0"
end
2 changes: 1 addition & 1 deletion pgpool_no_load_balance.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "activerecord", ">= 5.2.0"
spec.add_dependency "activerecord", ">= 7.2.0"
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "bundler/setup"
require "active_record"
require "pgpool_no_load_balance"

RSpec.configure do |config|
Expand Down