Skip to content

Commit

Permalink
Fix a few rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma committed Jan 13, 2025
1 parent 0bfa401 commit 523082e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def col.primary_key?
end

def rename_table _table_name, _new_name
raise ActiveRecordSpannerAdapter::NotSupportedError, \
raise ActiveRecordSpannerAdapter::NotSupportedError,
"rename_table is not implemented"
end

Expand Down Expand Up @@ -208,13 +208,13 @@ def change_column_null table_name, column_name, null, _default = nil
end

def change_column_default _table_name, _column_name, _default_or_changes
raise ActiveRecordSpannerAdapter::NotSupportedError, \
raise ActiveRecordSpannerAdapter::NotSupportedError,
"change column with default value not supported."
end

def rename_column table_name, column_name, new_column_name
if ActiveRecord::Base.connection.ddl_batch?
raise ActiveRecordSpannerAdapter::NotSupportedError, \
raise ActiveRecordSpannerAdapter::NotSupportedError,
"rename_column in a DDL Batch is not supported."
end
column = information_schema do |i|
Expand Down Expand Up @@ -642,8 +642,7 @@ def execute_schema_statements statements
end

def information_schema
info_schema = \
ActiveRecordSpannerAdapter::Connection.information_schema @config
info_schema = ActiveRecordSpannerAdapter::Connection.information_schema @config

return info_schema unless block_given?

Expand Down
4 changes: 2 additions & 2 deletions lib/activerecord_spanner_adapter/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def self.reset_information_schemas!

def self.information_schema config
@information_schemas ||= {}
@information_schemas[database_path(config)] ||= \
@information_schemas[database_path(config)] ||=
ActiveRecordSpannerAdapter::InformationSchema.new new(config)
end

Expand Down Expand Up @@ -204,7 +204,7 @@ def run_batch

def execute_query sql, params: nil, types: nil, single_use_selector: nil, request_options: nil
if params
converted_params, types = \
converted_params, types =
Google::Cloud::Spanner::Convert.to_input_params_and_types(
params, types
)
Expand Down

0 comments on commit 523082e

Please sign in to comment.