Skip to content

Commit

Permalink
Improve clarity within UrlHelper#lookup_admin_from_options
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Sep 16, 2024
1 parent fc8dd93 commit aa433a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/trestle/url_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aa433a3

Please sign in to comment.