Skip to content

Commit

Permalink
Fix warnings on Ruby 2.7
Browse files Browse the repository at this point in the history
Ruby 2.7 emits warnings when using `Proc.new` with no block.  This
commit just converts the code to use `&block` to avoid the warning.
  • Loading branch information
tenderlove committed Aug 15, 2019
1 parent 63e84fb commit 0f1416c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/will_paginate/deprecation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def []=(key, value)
super
end

def deprecate_key(*keys)
message = block_given? ? Proc.new : keys.pop
def deprecate_key(*keys, &block)
message = block_given? ? block : keys.pop
Array(keys).each { |key| @deprecated[key] = message }
end

Expand Down

0 comments on commit 0f1416c

Please sign in to comment.