Skip to content

Commit 5ee1542

Browse files
authored
Merge pull request rails#54361 from Earlopain/arel-unused-block-warning
Fix two unused block warnings in arel
2 parents d5e4f20 + 7b253be commit 5ee1542

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

actionpack/test/controller/filters_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def action_two
514514
@filters << "action_two"
515515
end
516516

517-
def non_yielding_action(&_)
517+
def non_yielding_action(&)
518518
@filters << "it didn't yield"
519519
end
520520

activejob/lib/active_job/enqueuing.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def perform_later(...)
8888
end
8989

9090
private
91-
def job_or_instantiate(*args, &_) # :doc:
91+
def job_or_instantiate(*args, &) # :doc:
9292
args.first.is_a?(self) ? args.first : new(*args)
9393
end
9494
ruby2_keywords(:job_or_instantiate)

activemodel/lib/active_model/attribute.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def initialize(name, value_before_type_cast, type, original_attribute = nil, val
3838
@value = value unless value.nil?
3939
end
4040

41-
def value(&_)
41+
def value(&)
4242
# `defined?` is cheaper than `||=` when we get back falsy values
4343
@value = type_cast(value_before_type_cast) unless defined?(@value)
4444
@value

activemodel/lib/active_model/type/big_integer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def serialize_cast_value(value) # :nodoc:
4444
value
4545
end
4646

47-
def serializable?(value, &_)
47+
def serializable?(value, &)
4848
true
4949
end
5050

activemodel/lib/active_model/type/value.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def initialize(precision: nil, limit: nil, scale: nil)
2525
# by the database. For example a boolean type can return +true+ if the
2626
# value parameter is a Ruby boolean, but may return +false+ if the value
2727
# parameter is some other object.
28-
def serializable?(value, &_)
28+
def serializable?(value, &)
2929
true
3030
end
3131

activerecord/lib/active_record/statement_cache.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ def <<(str)
7474
self
7575
end
7676

77-
def add_bind(obj)
77+
def add_bind(obj, &)
7878
@binds << obj
7979
@parts << Substitute.new
8080
self
8181
end
8282

83-
def add_binds(binds, proc_for_binds = nil)
83+
def add_binds(binds, proc_for_binds = nil, &)
8484
@binds.concat proc_for_binds ? binds.map(&proc_for_binds) : binds
8585
binds.size.times do |i|
8686
@parts << ", " unless i == 0

activerecord/lib/arel/collectors/bind.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def add_bind(bind, &)
1818
self
1919
end
2020

21-
def add_binds(binds, proc_for_binds = nil)
21+
def add_binds(binds, proc_for_binds = nil, &)
2222
@binds.concat proc_for_binds ? binds.map(&proc_for_binds) : binds
2323
self
2424
end

activerecord/lib/arel/collectors/sql_string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def initialize(*)
1212
@bind_index = 1
1313
end
1414

15-
def add_bind(bind)
15+
def add_bind(bind, &)
1616
self << yield(@bind_index)
1717
@bind_index += 1
1818
self

activerecord/lib/arel/collectors/substitute_binds.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ def <<(str)
1515
self
1616
end
1717

18-
def add_bind(bind)
18+
def add_bind(bind, &)
1919
bind = bind.value_for_database if bind.respond_to?(:value_for_database)
2020
self << quoter.quote(bind)
2121
end
2222

23-
def add_binds(binds, proc_for_binds = nil)
23+
def add_binds(binds, proc_for_binds = nil, &)
2424
self << binds.map { |bind| quoter.quote(bind) }.join(", ")
2525
end
2626

activerecord/lib/arel/nodes/binary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def eql?(other)
3030
end
3131

3232
module FetchAttribute
33-
def fetch_attribute
33+
def fetch_attribute(&)
3434
if left.is_a?(Arel::Attributes::Attribute)
3535
yield left
3636
elsif right.is_a?(Arel::Attributes::Attribute)

0 commit comments

Comments
 (0)