class URI::GID
def set_model_components(path, validate = false)
def set_model_components(path, validate = false) _, model_name, model_id = path.split('/', 3) validate_component(model_name) && validate_model_id_section(model_id, model_name) if validate @model_name = model_name if model_id model_id_parts = model_id .split(COMPOSITE_MODEL_ID_DELIMITER, COMPOSITE_MODEL_ID_MAX_SIZE) .reject(&:blank?) model_id_parts.map! do |id| validate_model_id(id) CGI.unescape(id) end @model_id = model_id_parts.length == 1 ? model_id_parts.first : model_id_parts end end