Sha256: 4f3046bb5627c669af460be66451f138791246d28e1aac9540d348f1bdffb737
Contents?: true
Size: 629 Bytes
Versions: 18
Compression:
Stored size: 629 Bytes
Contents
# frozen_string_literal: true module Mihari module Emitters class Database < Base def valid? true end def emit(title:, description:, artifacts:, source:, tags: []) return if artifacts.empty? tags = tags.map { |name| Tag.find_or_create_by(name: name) }.compact.uniq taggings = tags.map { |tag| Tagging.new(tag_id: tag.id) } alert = Alert.new( title: title, description: description, artifacts: artifacts, source: source, taggings: taggings ) alert.save alert end end end end
Version data entries
18 entries across 18 versions & 1 rubygems