app/controllers/registrations_controller.rb
def handle_org(attrs:)
    # DMPTool hack to deal with Org via IdP
    if attrs[:default_org_id].present?
      attrs[:org_id] = attrs[:default_org_id]
      attrs.delete(:default_org_id)
      return attrs
    else
      return attrs unless attrs.present? && attrs[:org_id].present?

      org = org_from_params(params_in: attrs, allow_create: true)

      # Remove the extraneous Org Selector hidden fields
      attrs = remove_org_selection_params(params_in: attrs)
      return attrs unless org.present?

      # reattach the org_id but with the Org id instead of the hash
      attrs[:org_id] = org.id
      attrs
    end
  end
# Finds or creates the selected org and then returns it's id
Finds or creates the selected org and then returns it's id
Finds or creates the selected org and then returns it ' s id
def handle_org(attrs:)
    if attrs[:default_org_id].present?
      attrs[:org_id] = attrs[:default_org_id]
      attrs.delete(:default_org_id)
      return attrs
    else
      return attrs unless attrs.present? && attrs[:org_id].present?
      org = org_from_params(params_in: attrs, allow_create: true)
      attrs = remove_org_selection_params(params_in: attrs)
      return attrs unless org.present?
      attrs[:org_id] = org.id
      attrs
    end
  end
def handle_org ( attrs : ) if attrs [ :default_org_id ] . present? attrs [ :org_id ] = attrs [ :default_org_id ] attrs . delete ( :default_org_id ) return attrs else return attrs unless attrs . present? && attrs [ :org_id ] . present? org = org_from_params ( params_in : attrs , allow_create : true ) attrs = remove_org_selection_params ( params_in : attrs ) return attrs unless org . present? attrs [ :org_id ] = org . id attrs end end
Finds or creates the selected org and then returns it's id
Finds or creates the selected org and then returns it ' s id
# DMPTool hack to deal with Org via IdP # Remove the extraneous Org Selector hidden fields # reattach the org_id but with the Org id instead of the hash
attrs