Skip to Content Skip to Search
Methods
C
M
P
Q
S
Included Modules

Attributes

[R] date
[R] run_time
[R] search_models
[R] search_time
[R] site
[R] site_id

Instance Public methods

content_hash()

# File engines/member/app/jobs/member/available_content_worker.rb, line 43
def content_hash
  @content_hash ||= fetch_content.map { |c| [hashed(c), c] }.to_h
end

members_with_content()

# File engines/member/app/jobs/member/available_content_worker.rb, line 35
def members_with_content
  @members_with_content ||= fetch_members_with_content_ids.map { |options|
    ids = options.delete(:content_ids)
    content = ids.map { |h| content_hash[hashed(h)] }
    options.merge(content: content)
  }
end

perform(site_id, run_time, search_time_int, search_models)

# File engines/member/app/jobs/member/available_content_worker.rb, line 9
def perform(site_id, run_time, search_time_int, search_models)
  set_state(site_id, run_time, search_time_int, search_models)

  queue_notifications
end

queue_notifications()

# File engines/member/app/jobs/member/available_content_worker.rb, line 24
def queue_notifications
  members_with_content.each do |options|
    content_email = create_content_email(
      options.fetch(:member),
      options.fetch(:content)
    )

    queue_email_job(content_email) if queue_email?(content_email)
  end
end

set_state(site_id, run_time, search_time_int, search_models)

# File engines/member/app/jobs/member/available_content_worker.rb, line 15
def set_state(site_id, run_time, search_time_int, search_models)
  @site = DB::Site.find(site_id)
  @site_id = site_id
  @run_time = run_time.symbolize_keys
  @date = Date.new(*@run_time.values_at(:year, :month, :day))
  @search_time = Time.zone.at(search_time_int)
  @search_models = search_models
end