Skip to content

Commit

Permalink
Use the id to compare addons
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Feb 4, 2020
1 parent c58ae93 commit 0c75d1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/registration/controllers/package_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ def disable_addon?(addon)
end

# Determines whether the addon is still needed
#
# @param addon [Addon] Addon to compare with
def needed_addon?(addon)
selected_packages.any? { |pkg| pkg.addon == addon }
selected_packages.any? { |pkg| pkg.addon && pkg.addon.id == addon.id }
end

# Asks a yes/no question
Expand Down

0 comments on commit 0c75d1b

Please sign in to comment.