Skip to content

Commit

Permalink
Merge pull request #8 from grnhse/fix_add_column_adapter
Browse files Browse the repository at this point in the history
Schema statements should no longer include hash arguments in rails 6
  • Loading branch information
tdphillipsjr authored Jan 5, 2024
2 parents 3643b9f + 0003206 commit 030cb9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion activerecord5-redshift-adapter.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'activerecord5-redshift-adapter'
s.version = '2.0.2'
s.version = '2.0.3'
s.summary = 'Amazon Redshift adapter for ActiveRecord '
s.description = 'Amazon Redshift adapter for ActiveRecord 6.x.'
s.license = 'MIT'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def add_column_options!(sql, options)
module SchemaStatements
# Drops the database specified on the +name+ attribute
# and creates it again using the provided +options+.
def recreate_database(name, options = {}) #:nodoc:
def recreate_database(name, **options) #:nodoc:
drop_database(name)
create_database(name, options)
end
Expand All @@ -58,7 +58,7 @@ def recreate_database(name, options = {}) #:nodoc:
# Example:
# create_database config[:database], config
# create_database 'foo_development', encoding: 'unicode'
def create_database(name, options = {})
def create_database(name, **options)
options = { encoding: 'utf8' }.merge!(options.symbolize_keys)

option_string = options.inject("") do |memo, (key, value)|
Expand Down Expand Up @@ -232,7 +232,7 @@ def create_schema schema_name
end

# Drops the schema for the given schema name.
def drop_schema(schema_name, options = {})
def drop_schema(schema_name, **options)
execute "DROP SCHEMA#{' IF EXISTS' if options[:if_exists]} #{quote_schema_name(schema_name)} CASCADE"
end

Expand Down Expand Up @@ -300,13 +300,13 @@ def rename_table(table_name, new_name)
execute "ALTER TABLE #{quote_table_name(table_name)} RENAME TO #{quote_table_name(new_name)}"
end

def add_column(table_name, column_name, type, options = {}) #:nodoc:
def add_column(table_name, column_name, type, **options) #:nodoc:
clear_cache!
super
end

# Changes the column of a table.
def change_column(table_name, column_name, type, options = {})
def change_column(table_name, column_name, type, **options)
clear_cache!
quoted_table_name = quote_table_name(table_name)
sql_type = type_to_sql(type, limit: options[:limit], precision: options[:precision], scale: options[:scale])
Expand Down Expand Up @@ -353,7 +353,7 @@ def rename_column(table_name, column_name, new_column_name) #:nodoc:
execute "ALTER TABLE #{quote_table_name(table_name)} RENAME COLUMN #{quote_column_name(column_name)} TO #{quote_column_name(new_column_name)}"
end

def add_index(table_name, column_name, options = {}) #:nodoc:
def add_index(table_name, column_name, **options) #:nodoc:
end

def remove_index!(table_name, index_name) #:nodoc:
Expand Down

0 comments on commit 030cb9a

Please sign in to comment.