diff --git a/activerecord6-redshift-adapter.gemspec b/activerecord6-redshift-adapter.gemspec index 5af1d20..aeb2be7 100644 --- a/activerecord6-redshift-adapter.gemspec +++ b/activerecord6-redshift-adapter.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.files = Dir.glob(['LICENSE', 'README.md', 'lib/**/*.rb']) s.require_path = 'lib' - s.required_ruby_version = '>= 3.0' + s.required_ruby_version = '>= 2.7' s.add_runtime_dependency 'activerecord', '~> 7.0' s.add_runtime_dependency 'pg', '~> 1.0' end diff --git a/lib/active_record/connection_adapters/redshift/schema_statements.rb b/lib/active_record/connection_adapters/redshift/schema_statements.rb index cc70ff3..3d62fb8 100644 --- a/lib/active_record/connection_adapters/redshift/schema_statements.rb +++ b/lib/active_record/connection_adapters/redshift/schema_statements.rb @@ -154,7 +154,7 @@ def columns(table_name) default_value = extract_value_from_default(default) type_metadata = fetch_type_metadata(column_name, type, oid, fmod) default_function = extract_default_function(default_value, default) - new_column(column_name, default_value, type_metadata, notnull == 'f', table_name, default_function) + new_column(column_name, default_value, type_metadata, !notnull, table_name, default_function) end end @@ -185,7 +185,7 @@ def ctype; end # Returns an array of schema names. def schema_names - select_value(<<-SQL, 'SCHEMA') + select_values(<<-SQL, 'SCHEMA') SELECT nspname FROM pg_namespace WHERE nspname !~ '^pg_.*' diff --git a/lib/active_record/connection_adapters/redshift_adapter.rb b/lib/active_record/connection_adapters/redshift_adapter.rb index 939bb58..efff8a5 100644 --- a/lib/active_record/connection_adapters/redshift_adapter.rb +++ b/lib/active_record/connection_adapters/redshift_adapter.rb @@ -762,8 +762,8 @@ def construct_coder(row, coder_class) coder_class.new(oid: row['oid'].to_i, name: row['typname']) end - def create_table_definition(*args) # :nodoc: - Redshift::TableDefinition.new(self, *args) + def create_table_definition(name, **options) # :nodoc: + Redshift::TableDefinition.new(self, name, **options) end end end