Skip to content

Commit

Permalink
Remove unused local variables
Browse files Browse the repository at this point in the history
These were found by running the specs with --parser=prism in
Ruby 3.4.0-preview1.
  • Loading branch information
jeremyevans committed Jun 7, 2024
1 parent 326df13 commit 73fed97
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sequel/adapters/shared/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ def merge_do_nothing_when_not_matched(&block)
# Support OVERRIDING USER|SYSTEM VALUE for MERGE INSERT.
def merge_insert(*values, &block)
h = {:type=>:insert, :values=>values}
if override = @opts[:override]
if @opts[:override]
h[:override] = insert_override_sql(String.new)
end
_merge_when(h, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/sequel/plugins/association_pks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def convert_pk_array(opts, pks)
sch = klass.db_schema

if primary_key.is_a?(Array)
if (cols = sch.values_at(*klass.primary_key)).all? && (convs = cols.map{|c| c[:type] == :integer}).all?
if (cols = sch.values_at(*klass.primary_key)).all? && (cols.map{|c| c[:type] == :integer}).all?
db = model.db
pks.map do |cpk|
cpk.map do |pk|
Expand Down
2 changes: 1 addition & 1 deletion lib/sequel/plugins/validate_associated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def delay_validate_associated_object(reflection, obj)
def validate_associated_object(reflection, obj)
return if reflection[:validate] == false
association = reflection[:name]
if (reflection[:type] == :one_to_many || reflection[:type] == :one_to_one) && (key = reflection[:key]).is_a?(Symbol) && !(pk_val = obj.values[key])
if (reflection[:type] == :one_to_many || reflection[:type] == :one_to_one) && (key = reflection[:key]).is_a?(Symbol) && !(obj.values[key])
p_key = pk unless pk.is_a?(Array)
if p_key
obj.values[key] = p_key
Expand Down

0 comments on commit 73fed97

Please sign in to comment.