From 289c3aed112ad6ef736343f37c60d46284726169 Mon Sep 17 00:00:00 2001 From: Anita Graham Date: Mon, 17 Aug 2026 11:53:39 +0800 Subject: [PATCH] fix: use initialize signature compatible with ActionPack 8.1.3 ActionDispatch::MiddlewareStack::Middleware expects 2 arguments, but sees `initialize(app, options={})` as having one argument. --- lib/ipinfo-rails.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ipinfo-rails.rb b/lib/ipinfo-rails.rb index 80928fb..e1691fb 100644 --- a/lib/ipinfo-rails.rb +++ b/lib/ipinfo-rails.rb @@ -17,7 +17,7 @@ def is_bot(request) end class IPinfoMiddleware - def initialize(app, options = {}) + def initialize(app, _args = [], **options ) @app = app @token = options.fetch(:token, nil) @ipinfo = IPinfo.create(@token, options) @@ -47,7 +47,7 @@ def call(env) end class IPinfoLiteMiddleware - def initialize(app, options = {}) + def initialize(app, _args = [], **options ) @app = app @token = options.fetch(:token, nil) @ipinfo = IPinfoLite.create(@token, options) @@ -77,7 +77,7 @@ def call(env) end class IPinfoCoreMiddleware - def initialize(app, options = {}) + def initialize(app, _args = [], **options) @app = app @token = options.fetch(:token, nil) @ipinfo = IPinfoCore.create(@token, options) @@ -107,7 +107,7 @@ def call(env) end class IPinfoPlusMiddleware - def initialize(app, options = {}) + def initialize(app, _args = [], **options) @app = app @token = options.fetch(:token, nil) @ipinfo = IPinfoPlus.create(@token, options) @@ -137,7 +137,7 @@ def call(env) end class IPinfoResproxyMiddleware - def initialize(app, options = {}) + def initialize(app, _args = [], **options) @app = app @token = options.fetch(:token, nil) @ipinfo = IPinfo.create(@token, options)