Commit 2b9702e9 authored by Avielle Wolfe's avatar Avielle Wolfe

Make VulnerabilitiesActions module agnostic

parent 509ad2c3
# frozen_string_literal: true # frozen_string_literal: true
# The VulnerabilitiesActions concern contains actions that are used to populate vulnerabilities
# on security dashboards.
#
# Note: Consumers of this module will need to define a `def vulnerable` method, which must return
# an object with an interface that matches the one provided by the Vulnerable model concern.
module VulnerabilitiesActions module VulnerabilitiesActions
extend ActiveSupport::Concern extend ActiveSupport::Concern
...@@ -46,6 +52,6 @@ module VulnerabilitiesActions ...@@ -46,6 +52,6 @@ module VulnerabilitiesActions
end end
def found_vulnerabilities(collection = :latest) def found_vulnerabilities(collection = :latest)
::Security::VulnerabilitiesFinder.new(group, params: filter_params).execute(collection) ::Security::VulnerabilitiesFinder.new(vulnerable, params: filter_params).execute(collection)
end end
end end
...@@ -2,4 +2,10 @@ ...@@ -2,4 +2,10 @@
class Groups::Security::VulnerabilitiesController < Groups::Security::ApplicationController class Groups::Security::VulnerabilitiesController < Groups::Security::ApplicationController
include VulnerabilitiesActions include VulnerabilitiesActions
private
def vulnerable
group
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment