Module: Sipity::Commands::CitationCommands

Extended by:
ActiveSupport::Concern
Defined in:
app/repositories/sipity/commands/citation_commands.rb

Overview

Commands

Instance Method Summary collapse

Instance Method Details

#submit_assign_a_citation_form(form, requested_by:) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/repositories/sipity/commands/citation_commands.rb', line 11

def submit_assign_a_citation_form(form, requested_by:)
  form.submit do |f|
    AdditionalAttributeCommands.update_sip_attribute_values!(
      sip: f.sip, key: Models::AdditionalAttribute::CITATION_PREDICATE_NAME, values: f.citation
    )
    AdditionalAttributeCommands.update_sip_attribute_values!(
      sip: f.sip, key: Models::AdditionalAttribute::CITATION_TYPE_PREDICATE_NAME, values: f.type
    )
    EventLogCommands.log_event!(entity: f.sip, user: requested_by, event_name: __method__)
    f.sip
  end
end