app/services/dashboard/rescoping_service.rb
# find or create friendly_id entry for project
find or create friendly_id entry for project
find or create friendly_id entry for project
def project_friendly_id(domain_id, project_fid_or_key)
      entry = FriendlyIdEntry.find_by_class_scope_and_key_or_slug(
        'Project', domain_id, project_fid_or_key
      )
      if entry.nil? && @service_user
        project = @service_user.identity.projects(
          domain_id: domain_id, name: project_fid_or_key
        ).first || @service_user.identity.find_project(project_fid_or_key)
        if project
          entry = FriendlyIdEntry.find_or_create_entry(
            'Project', project.domain_id, project.id, project.attributes['name']
          )
        end
      end
      entry
    end
def project_friendly_id ( domain_id , project_fid_or_key ) entry = FriendlyIdEntry . find_by_class_scope_and_key_or_slug ( 'Project' , domain_id , project_fid_or_key ) if entry . nil? && @service_user project = @service_user . identity . projects ( domain_id : domain_id , name : project_fid_or_key ) . first || @service_user . identity . find_project ( project_fid_or_key ) if project entry = FriendlyIdEntry . find_or_create_entry ( 'Project' , project . domain_id , project . id , project . attributes [ 'name' ] ) end end entry end
find or create friendly_id entry for project
find or create friendly_id entry for project
# try to find an entry by given fid or key # no entry found -> create a new one # create friendly_id entry
domain_id
<not_specific>
project_fid_or_key
<not_specific>