app/helpers/admin/taggable_content_helper.rb
def taggable_needs_container
    Rails.cache.fetch("need.linkables", expires_in: 1.minute) do
      Services.publishing_api_with_low_timeout.get_linkables(document_type: "need").to_a.map do |need|
        need.values_at("title", "content_id")
      end
    end
  rescue GdsApi::TimedOutException, GdsApi::HTTPServerError
    stale_data = Rails.cache.fetch("need.linkables")
    return stale_data if stale_data

    raise
  end
# Returns an Array that represents the current set of taggable topical
# events. Each element of the array consists of two values: the name and ID
# of the topical event.
Returns an Array that represents the current set of taggable topical
events. Each element of the array consists of two values: the name and ID
of the topical event.
Returns an Array that represents the current set of taggable topical events . Each element of the array consists of two values : the name and ID of the topical event .
def taggable_needs_container
    Rails.cache.fetch("need.linkables", expires_in: 1.minute) do
      Services.publishing_api_with_low_timeout.get_linkables(document_type: "need").to_a.map do |need|
        need.values_at("title", "content_id")
      end
    end
  rescue GdsApi::TimedOutException, GdsApi::HTTPServerError
    stale_data = Rails.cache.fetch("need.linkables")
    return stale_data if stale_data
    raise
  end
def taggable_needs_container Rails . cache . fetch ( "need.linkables" , expires_in : 1 . minute ) do Services . publishing_api_with_low_timeout . get_linkables ( document_type : "need" ) . to_a . map do | need | need . values_at ( "title" , "content_id" ) end end rescue GdsApi :: TimedOutException , GdsApi :: HTTPServerError stale_data = Rails . cache . fetch ( "need.linkables" ) return stale_data if stale_data raise end
Returns an Array that represents the current set of taggable topical
events.
Returns an Array that represents the current set of taggable topical events .