Fix deprecated keyword argument warnings in Ruby 2.7.

Fix this warning:

    warning: Using the last argument as keyword parameters is
    deprecated; maybe ** should be added to the call.

ref: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#delegation
This commit is contained in:
evazion
2020-02-16 18:44:23 -06:00
parent af4891bf4c
commit ed702b8854
3 changed files with 8 additions and 8 deletions

View File

@@ -236,8 +236,8 @@ module ApplicationHelper
simple_form_for(model, **options, &block)
end
def table_for(*options, &block)
table = TableBuilder.new(*options, &block)
def table_for(*args, **options, &block)
table = TableBuilder.new(*args, **options, &block)
render "table_builder/table", table: table
end

View File

@@ -49,8 +49,8 @@ class TableBuilder
yield self if block_given?
end
def column(*options, &block)
@columns << Column.new(*options, &block)
def column(*args, **options, &block)
@columns << Column.new(*args, **options, &block)
end
def all_row_attributes(item, i)

View File

@@ -3,8 +3,8 @@ class ApplicationRecord < ActiveRecord::Base
concerning :PaginationMethods do
class_methods do
def paginate(*options)
extending(PaginationExtension).paginate(*options)
def paginate(*args, **options)
extending(PaginationExtension).paginate(*args, **options)
end
def paginated_search(params, defaults: {}, count_pages: params[:search].present?)
@@ -413,9 +413,9 @@ class ApplicationRecord < ActiveRecord::Base
concerning :UserMethods do
class_methods do
def belongs_to_updater(options = {})
def belongs_to_updater(**options)
class_eval do
belongs_to :updater, options.merge(class_name: "User")
belongs_to :updater, class_name: "User", **options
before_validation do |rec|
rec.updater_id = CurrentUser.id
rec.updater_ip_addr = CurrentUser.ip_addr if rec.respond_to?(:updater_ip_addr=)