Sha256: c436c58c2c737aab94eff3635c051e8025504a155d4bfcaa6b3769e619c56b1c
Contents?: true
Size: 970 Bytes
Versions: 16
Compression:
Stored size: 970 Bytes
Contents
module Dradis::Plugins::ContentService module Evidence extend ActiveSupport::Concern def create_evidence(args={}) content = args.fetch(:content, default_evidence_content) node = args.fetch(:node, default_node_parent) issue = args[:issue] || default_evidence_issue evidence = node.evidence.new(issue_id: issue.id, content: content) if evidence.valid? evidence.save else try_rescue_from_length_validation( model: evidence, field: :content, text: content, msg: 'Error in create_evidence()' ) end evidence end private def default_evidence_content "create_evidence() invoked by #{plugin} without a :content parameter" end def default_evidence_issue create_issue(text: "#[Title]#\nAuto-generated issue.\n\n#[Description]#\ncreate_evidence() invoked by #{plugin} without an :issue parameter") end end end
Version data entries
16 entries across 16 versions & 1 rubygems