Skip to content

Commit

Permalink
fix: test and format errors
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Oct 30, 2023
1 parent b8795bc commit 998bc5c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/snippets/tags/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require_relative "models/album"

class Application
def self.run # rubocop:disable Metrics/AbcSize
def self.run
# Query all albums and include a request tag for the statement.
puts ""
puts "Query all Albums and include a request tag"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def execute sql, name = nil, binds = []
@connection.execute_query sql, params: params, types: types, request_options: request_options
end
else
@connection.execute_query sql, params: params, types: types, single_use_selector: selector, request_options: request_options
@connection.execute_query sql, params: params, types: types, single_use_selector: selector,
request_options: request_options
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/activerecord_spanner_adapter/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def execute_query sql, params: nil, types: nil, single_use_selector: nil, reques
end

selector = transaction_selector || single_use_selector
execute_sql_request sql, converted_params, types, selector, request_options = request_options
execute_sql_request sql, converted_params, types, selector, request_options
end

def execute_sql_request sql, converted_params, types, selector, request_options = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/arel/visitors/spanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def visit_Arel_Nodes_OptimizerHints o, collector
collector
end

def visit_Arel_Nodes_Comment(o, collector)
def visit_Arel_Nodes_Comment o, collector
o.values.each do |v|
if v.start_with?("request_tag:") || v.start_with?("transaction_tag:")
collector.hints[:request_options] ||= \
Expand Down
5 changes: 3 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@ def release!
end

def execute_query sql, params: nil, types: nil, transaction: nil,
partition_token: nil, seqno: nil
partition_token: nil, request_options: nil, seqno: nil
MockGoogleSpanner.last_executed_sqls OpenStruct.new(
sql: sql, options: {
params: params, types: types, transaction: transaction,
partition_token: partition_token, seqno: seqno
partition_token: partition_token, request_options: request_options,
seqno: seqno
}
)
OpenStruct.new(rows: MockGoogleSpanner.mocked_result || [])
Expand Down

0 comments on commit 998bc5c

Please sign in to comment.