@@ -361,9 +361,9 @@ def avg(*args)
361361 # @return [Relation]
362362 #
363363 # @api public
364- def where ( *args , &block )
365- if block
366- where ( *args ) . where ( schema . canonical . restriction ( &block ) )
364+ def where ( *args , &)
365+ if block_given?
366+ where ( *args ) . where ( schema . canonical . restriction ( &) )
367367 elsif args . size == 1 && args [ 0 ] . is_a? ( Hash )
368368 new ( dataset . where ( coerce_conditions ( args [ 0 ] ) ) )
369369 elsif !args . empty?
@@ -420,9 +420,9 @@ def exclude(...)
420420 # @return [Relation]
421421 #
422422 # @api public
423- def having ( *args , &block )
424- if block
425- new ( dataset . having ( *args , *schema . canonical . restriction ( &block ) ) )
423+ def having ( *args , &)
424+ if block_given?
425+ new ( dataset . having ( *args , *schema . canonical . restriction ( &) ) )
426426 else
427427 new ( dataset . __send__ ( __method__ , *args ) )
428428 end
@@ -475,11 +475,11 @@ def invert
475475 # @return [Relation]
476476 #
477477 # @api public
478- def order ( *args , &block )
479- if block
480- new ( dataset . order ( *args , *schema . canonical . order ( &block ) ) )
478+ def order ( *args , &)
479+ if block_given?
480+ new ( dataset . order ( *args , *schema . canonical . order ( &) ) )
481481 else
482- new ( dataset . __send__ ( __method__ , *args , &block ) )
482+ new ( dataset . __send__ ( __method__ , *args , &) )
483483 end
484484 end
485485
@@ -724,12 +724,12 @@ def right_join(...)
724724 # @return [Relation]
725725 #
726726 # @api public
727- def group ( *args , &block )
728- if block
727+ def group ( *args , &)
728+ if block_given?
729729 if args . size . positive?
730- group ( *args ) . group_append ( &block )
730+ group ( *args ) . group_append ( &)
731731 else
732- new ( dataset . __send__ ( __method__ , *schema . canonical . group ( &block ) ) )
732+ new ( dataset . __send__ ( __method__ , *schema . canonical . group ( &) ) )
733733 end
734734 else
735735 new ( dataset . __send__ ( __method__ , *schema . canonical . project ( *args ) ) )
@@ -763,12 +763,12 @@ def group(*args, &block)
763763 # @return [Relation]
764764 #
765765 # @api public
766- def group_append ( *args , &block )
767- if block
766+ def group_append ( *args , &)
767+ if block_given?
768768 if args . size . positive?
769- group_append ( *args ) . group_append ( &block )
769+ group_append ( *args ) . group_append ( &)
770770 else
771- new ( dataset . group_append ( *schema . canonical . group ( &block ) ) )
771+ new ( dataset . group_append ( *schema . canonical . group ( &) ) )
772772 end
773773 else
774774 new ( dataset . group_append ( *args ) )
@@ -910,12 +910,12 @@ def read(sql)
910910 # @yieldparam relation [Array]
911911 #
912912 # @api public
913- def lock ( **options , &block )
913+ def lock ( **options , &)
914914 clause = lock_clause ( **options )
915915
916- if block
916+ if block_given?
917917 transaction do
918- block . call ( dataset . lock_style ( clause ) . to_a )
918+ yield ( dataset . lock_style ( clause ) . to_a )
919919 end
920920 else
921921 new ( dataset . lock_style ( clause ) )
@@ -1094,21 +1094,21 @@ def coerce_conditions(conditions)
10941094 # @api private
10951095 #
10961096 # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/MethodLength, Metrics/CyclomaticComplexity
1097- def __join__ ( type , other , join_cond = EMPTY_HASH , opts = EMPTY_HASH , &block )
1097+ def __join__ ( type , other , join_cond = EMPTY_HASH , opts = EMPTY_HASH , &)
10981098 if other . is_a? ( Symbol ) || other . is_a? ( ROM ::Relation ::Name )
1099- if join_cond . equal? ( EMPTY_HASH ) && !block
1099+ if join_cond . equal? ( EMPTY_HASH ) && !block_given?
11001100 assoc = associations [ other ]
11011101 assoc . join ( type , self )
1102- elsif block
1103- __join__ ( type , other , JoinDSL . new ( schema ) . ( &block ) , opts )
1102+ elsif block_given?
1103+ __join__ ( type , other , JoinDSL . new ( schema ) . ( &) , opts )
11041104 else
1105- new ( dataset . __send__ ( type , other . to_sym , join_cond , opts , &block ) )
1105+ new ( dataset . __send__ ( type , other . to_sym , join_cond , opts , &) )
11061106 end
1107- elsif other . is_a? ( Sequel ::SQL ::AliasedExpression )
1108- new ( dataset . __send__ ( type , other , join_cond , opts , &block ) )
1107+ elsif other . is_a? ( :: Sequel ::SQL ::AliasedExpression )
1108+ new ( dataset . __send__ ( type , other , join_cond , opts , &) )
11091109 elsif other . respond_to? ( :name ) && other . name . is_a? ( Relation ::Name )
11101110 if block
1111- join_cond = JoinDSL . new ( schema ) . ( &block )
1111+ join_cond = JoinDSL . new ( schema ) . ( &)
11121112
11131113 if other . name . aliaz
11141114 join_opts = { table_alias : other . name . aliaz }
0 commit comments