Class: ExternalReleaseEvent

Inherits:
Event show all
Defined in:
app/models/external_release_event.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Event

#request, #request?

Methods included from Event::RequestDescriptorUpdateEvent

included, #library_creation_descriptor?, #pass_or_fail_event?, #set_request_metadata, #update_metadata_for_request

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Squishify

extended

Instance Attribute Details

#send_emailObject

Returns the value of attribute send_email.



6
7
8
# File 'app/models/external_release_event.rb', line 6

def send_email
  @send_email
end

Class Method Details

.create_for_asset!(asset, sendmail = false) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'app/models/external_release_event.rb', line 8

def self.create_for_asset!(asset, sendmail = false)
  create!(
    eventful: asset,
    message: "Data to be released externally set #{asset.external_release}",
    created_by: '',
    family: 'update',
    of_interest_to: 'administrators',
    send_email: sendmail
  )
end

Instance Method Details

#physically_send_emailObject



23
24
25
26
27
28
29
# File 'app/models/external_release_event.rb', line 23

def physically_send_email
  studies = eventful.studies
  users = studies.reduce([]) { |users, study| users.concat(study.mailing_list_of_managers.compact_blank) }
  return false if users.empty?

  EventfulMailer.confirm_external_release_event(users.uniq, eventful, message, content, 'No Milestone').deliver_now
end

#set_qc_stateObject



19
20
21
# File 'app/models/external_release_event.rb', line 19

def set_qc_state
  # This method should be empty!
end