From b1d3369d418383bd4e14946b723e4a39c0534a8a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 9 Aug 2026 22:39:28 +0200 Subject: Remove the Rails 3.2 create_database patch It rewrote the method to work around Enumerable#sum refusing a String seed under Ruby 2.4, and has been obsolete since Rails 3.2 was left behind. It kept shadowing the adapter, dropping the collation, ctype, locale and locale_provider options Rails 8 supports --- config/initializers/postgresql_adapter_patch.rb | 30 ------------------------- 1 file changed, 30 deletions(-) delete mode 100644 config/initializers/postgresql_adapter_patch.rb (limited to 'config/initializers') diff --git a/config/initializers/postgresql_adapter_patch.rb b/config/initializers/postgresql_adapter_patch.rb deleted file mode 100644 index 57df6a20..00000000 --- a/config/initializers/postgresql_adapter_patch.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'active_record/connection_adapters/postgresql_adapter' - -module ActiveRecord - module ConnectionAdapters - class PostgreSQLAdapter - def create_database(name, options = {}) - options = options.reverse_merge(:encoding => "utf8") - - option_string = options.symbolize_keys.inject("") do |memo, (key, value)| - memo + case key - when :owner - " OWNER = \"#{value}\"" - when :template - " TEMPLATE = \"#{value}\"" - when :encoding - " ENCODING = '#{value}'" - when :tablespace - " TABLESPACE = \"#{value}\"" - when :connection_limit - " CONNECTION LIMIT = #{value}" - else - "" - end - end - - execute "CREATE DATABASE #{quote_table_name(name)}#{option_string}" - end - end - end -end -- cgit v1.3