lib/dradis/plugins/content_service/issues.rb in dradis-plugins-3.9.0 vs lib/dradis/plugins/content_service/issues.rb in dradis-plugins-3.10.0
- old
+ new
@@ -1,11 +1,11 @@
module Dradis::Plugins::ContentService
module Issues
extend ActiveSupport::Concern
def all_issues
- Issue.where(category_id: default_issue_category.id)
+ project.issues.where(category_id: default_issue_category.id)
end
def create_issue(args={})
text = args.fetch(:text, default_issue_text)
# NOTE that ID is the unique issue identifier assigned by the plugin,
@@ -24,11 +24,11 @@
"\n\n#[plugin_id]#\n#{uuid[1]}\n"
text << plugin_details
issue = Issue.new(text: text) do |i|
i.author = default_author
- i.node = issue_library
+ i.node = project.issue_library
i.category = default_issue_category
end
if issue.valid?
issue.save
@@ -62,11 +62,11 @@
# Accesing the library by primary sorting key. Raise an exception unless
# the issue library cache has been initialized.
def issue_cache
@issue_cache ||= begin
- issues_map = Issue.where(category_id: default_issue_category.id).map do |issue|
+ issues_map = all_issues.map do |issue|
cache_key = [
issue.fields['plugin'],
issue.fields['plugin_id']
].join('-')
@@ -88,12 +88,7 @@
end
def default_issue_text
"create_issue() invoked by #{plugin} without a :text parameter"
end
-
- def issue_library
- @issue_library ||= Node.issue_library
- end
-
end
end