From aa433a374753565dd60ad2fd35c9fb14fccbd8c7 Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Tue, 17 Sep 2024 09:06:02 +0930 Subject: [PATCH] Improve clarity within UrlHelper#lookup_admin_from_options --- app/helpers/trestle/url_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/trestle/url_helper.rb b/app/helpers/trestle/url_helper.rb index fd28bc0c..b5630dbd 100644 --- a/app/helpers/trestle/url_helper.rb +++ b/app/helpers/trestle/url_helper.rb @@ -138,10 +138,10 @@ def lookup_admin_from_options(instance: nil, admin: nil, fallback: nil, raise: t result = fallback end - if result + if result && result.is_a?(Class) # Instantiate admin with current context - result = result.new(self) if result.is_a?(Class) - + result.new(self) + elsif result result elsif raise raise ActionController::UrlGenerationError,