From 601f05e746dd8b1acb17fc67a4bcec0a5a226b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20B=C3=B6hme?= Date: Wed, 30 Mar 2022 12:19:22 +0200 Subject: [PATCH] Decrease number of deprecation warnings in Ruby 2.7 --- lib/cell/builder.rb | 2 +- lib/cell/caching.rb | 2 +- lib/cell/view_model.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cell/builder.rb b/lib/cell/builder.rb index 26422758..16f32fe4 100644 --- a/lib/cell/builder.rb +++ b/lib/cell/builder.rb @@ -9,7 +9,7 @@ def self.included(base) module ClassMethods def build(*args) - build!(self, *args).new(*args) # Declarative::Builder#build!. + build!(self, *args, **{}).new(*args) # Declarative::Builder#build!. end end end diff --git a/lib/cell/caching.rb b/lib/cell/caching.rb index d4fca400..206c49ba 100644 --- a/lib/cell/caching.rb +++ b/lib/cell/caching.rb @@ -51,7 +51,7 @@ def render_state(state, *args, **kws) key = self.class.state_cache_key(state, self.class.version_procs[state].(*cache_filter_args, exec_context: self)) options = self.class.cache_options[state].(*cache_filter_args, exec_context: self) - fetch_from_cache_for(key, options) { super(state, *cache_filter_args) } + fetch_from_cache_for(key, options) { super(state, *cache_filter_args, **kws) } end def cache_store # we want to use DI to set a cache store in cell/rails. diff --git a/lib/cell/view_model.rb b/lib/cell/view_model.rb index 118366de..8cdc66cf 100644 --- a/lib/cell/view_model.rb +++ b/lib/cell/view_model.rb @@ -28,9 +28,9 @@ def self.controller_path module Helpers # Constantizes name if needed, call builders and returns instance. - def cell(name, *args, **kws, &block) # classic Rails fuzzy API. + def cell(name, *args, &block) # classic Rails fuzzy API. constant = name.is_a?(Class) ? name : class_from_cell_name(name) - constant.(*args, **kws, &block) + constant.(*args, &block) end end extend Helpers