Closed petar-lazarov closed 3 years ago
Thanks! Wouldn't it be better, though, to change it properly here?
def method_missing(method, *args, **kws, &block)
# Send the route helpers to the application router.
if route_defined?(method)
controller.send(method, *args, **kws, &block)
Thanks! Wouldn't it be better, though, to change it properly here?
I was not sure if it is going to work for older versions of ruby and also with the call to super
but I guess it is going to be OK.
Just to be sure, I ran my cells tests with the new code on ruby 2.6 and ruby 3 and they are executing fine.
Maybe we should limit the new version to Ruby >= 2.7.
@yogeshjain999 Could you kindly add CI? :heart:
Haha, sorry @yogeshjain999 I just realized there's CI set up! :beers:
Successfully registered gem: rspec-cells (0.3.6)
:rock:
The delegation in
#method_missing
is breaking with ruby 3 because for ruby 3 the delegation should explicitly delegate both positional and keyword arguments. I'm using ruby2_keywords to keep the old behavior until the support of ruby < 3 is dropped.The method
ruby2_keywords
is present only in rubies that are>= 2.7
and that is why the checkif respond_to?(:ruby2_keywords, true)
is needed.