From aa512e3c6b6462f67c48bc1cb41277cb6ae30864 Mon Sep 17 00:00:00 2001 From: Nikita Shilnikov Date: Tue, 31 Dec 2024 09:37:45 +0100 Subject: [PATCH] Remove ruby2_keywords --- lib/rom/sql/schema/index_dsl.rb | 3 +-- spec/support/helpers.rb | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/rom/sql/schema/index_dsl.rb b/lib/rom/sql/schema/index_dsl.rb index 918494f5d..a0607cd2f 100644 --- a/lib/rom/sql/schema/index_dsl.rb +++ b/lib/rom/sql/schema/index_dsl.rb @@ -14,14 +14,13 @@ class IndexDSL # < BasicObject attr_reader :registry # @api private - def initialize(*, &block) + def initialize(*, **, &block) super @registry = [] instance_exec(&block) end - ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true) # @api public def index(*attributes, **options) diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index a4b9b9282..87fa3173a 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -22,12 +22,11 @@ def define_attribute(name, id, **opts) ROM::SQL::Attribute.new(type.meta(opts), name: name) end - def build_assoc(type, *args) + def build_assoc(type, *args, **kwargs) klass = ROM::Inflector.classify(type) - definition = ROM::Associations::Definitions.const_get(klass).new(*args) + definition = ROM::Associations::Definitions.const_get(klass).new(*args, **kwargs) ROM::SQL::Associations.const_get(definition.type).new(definition, relations) end - ruby2_keywords(:build_assoc) if respond_to?(:ruby2_keywords, true) def attributes(schema) schema.each_with_object({}) do |(key, type), acc|