Class: ActiveStix::ObjectMarking

Inherits:
ApplicationRecord show all
Defined in:
app/models/active_stix/object_marking.rb

Class Method Summary collapse

Class Method Details

.string_ingest(marking_id, relationship_id) ⇒ Object

belongs_to :relationship, :class_name => ‘ActiveStix::Relationship’, foreign_key: :active_stix_relationship_id, primary_key: :active_stix_id belongs_to :marking_definition, :class_name => ‘ActiveStix::MarkingDefinition’, foreign_key: :active_stix_marking_defintion_id, primary_key: :active_stix_id todo



6
7
8
9
10
# File 'app/models/active_stix/object_marking.rb', line 6

def self.string_ingest(marking_id, relationship_id)
  marking_definition = ActiveStix::MarkingDefinition.find_or_create_by(stix_id: marking_id)
  relationship = ActiveStix::Relationship.find_or_create_by(stix_id: relationship_id)
  find_or_create_by(marking_definition:marking_definition, relationship:relationship)
end