<commit_before>Rails.application.routes.draw do
  devise_for :users, skip: :invitations,
    controllers: { password_expired: 'devise_overrides/password_expired' }
  devise_scope :user do
    authenticated do
      root to: 'dashboard#index', as: :root
    end

    unauthenticated do
      root to: 'devise/sessions#new', as: :unauthenticated_root
    end
  end

  get 'pledge', to: 'home#pledge'

  resources :communities, param: :slug, only: [] do
    devise_for :users, only: [:invitations], controllers: { invitations: "invitations" }
    get 'admin', to: 'admin/friends#index'
    get 'dashboard', to: 'dashboard#index'

    resources :users, only: [:edit, :update]
    resources :friends, only: [:index, :show, :update] do
      resources :drafts do
        member do
          get :submit_for_review
          get :approve
        end
        resources :reviews, only: [:new, :show, :create, :edit, :update]
      end
      resources :releases, only: [:new, :create]
    end
    resources :accompaniments
    resources :activities, only: [:index]

    namespace :admin do
    	resources :users
      resources :access_time_slots, except: [:show]
      resources :activities, except: [:destroy] do
        collection do
          get :accompaniments
        end
        member do
          get :confirm
          get :unconfirm
        end
      end
      resources :friends do
        resources :activities, controller: 'friends/activities' do
          member do
            get :confirm
            get :unconfirm
          end
        end
        resources :detentions, controller: 'friends/detentions'
        resources :family_relationships
      end

      resources :judges, except: [:show, :destroy]
      resources :locations, except: [:show, :destroy]
      resources :sanctuaries, except: [:show, :destroy]
      resources :lawyers, except: [:show, :destroy]

      resources :events do
        member do
          get :attendance
        end
        resources :user_event_attendances, only: [:create, :destroy]
        resources :friend_event_attendances, only: [:create, :destroy]
      end

      resources :cohorts do
        member do
          get :assignment
        end
        resources :friend_cohort_assignments, only: [:create, :update, :destroy]
      end

      get 'reports/new', to: 'reports#new'
      post 'reports/create', to: 'reports#create'
    end

    namespace :accompaniment_leader do
      resources :friends, only: [:show] do
        resources :activities, controller: 'friends/activities', only: [:new, :create]
      end
      resources :activities, only: [:index] do
        resources :accompaniment_reports, only: [:edit, :new, :create, :update]
      end
    end
  end

  namespace :regional_admin do
    devise_for :users, only: [:invitations], controllers: { invitations: "invitations" }
    resources :regions, only: [] do
      resources :communities, only: [:index, :new, :create, :edit, :update]
      resources :friends, only: [:index, :show, :update] do
        resources :applications, only: [] do
          get :close
        end
      end
    end
    resources :remote_lawyers, only: [:index, :destroy, :edit, :update]
  end

  namespace :remote_clinic do
    resources :friends, only: [:index, :show] do
      resources :releases, only: [:new, :create, :destroy]
    end
  end

	match '/404', to: 'errors#not_found', via: :all
	match '/500', to: 'errors#internal_server_error', via: :all<commit_msg>cleanup routes to match existing controller methods<commit_after>Rails.application.routes.draw do
  devise_for :users, skip: :invitations,
    controllers: { password_expired: 'devise_overrides/password_expired' }
  devise_scope :user do
    authenticated do
      root to: 'dashboard#index', as: :root
    end

    unauthenticated do
      root to: 'devise/sessions#new', as: :unauthenticated_root
    end
  end

  get 'pledge', to: 'home#pledge'

  resources :communities, param: :slug, only: [] do
    devise_for :users, only: [:invitations], controllers: { invitations: "invitations" }

    get 'admin', to: 'admin/friends#index'
    get 'dashboard', to: 'dashboard#index'

    resources :users, only: [:edit, :update]
    resources :friends, only: [:index, :show, :update] do
      resources :drafts do
        member do
          get :submit_for_review
          get :approve
        end
        resources :reviews, except: [:index, :destroy]
      end
      resources :releases, only: [:new, :create]
    end
    resources :accompaniments, only: [:create, :update]
    resources :activities, only: [:index]

    namespace :admin do
    	resources :users, except: [:new, :create, :show]
      resources :access_time_slots, except: [:show]
      resources :activities, except: [:destroy] do
        collection do
          get :accompaniments
        end
        member do
          get :confirm
          get :unconfirm
        end
      end
      resources :friends, except: [:show] do
        resources :activities, controller: 'friends/activities', except: [:index, :show] do
          member do
            get :confirm
            get :unconfirm
          end
        end
        resources :detentions, controller: 'friends/detentions', except: [:index, :show]
        resources :family_relationships, only: [:new, :create, :destroy]
      end

      resources :judges, except: [:show, :destroy]
      resources :locations, except: [:show, :destroy]
      resources :sanctuaries, except: [:show, :destroy]
      resources :lawyers, except: [:show, :destroy]

      resources :events, except: [:show] do
        member do
          get :attendance
        end
        resources :user_event_attendances, only: [:create, :destroy]
        resources :friend_event_attendances, only: [:create, :destroy]
      end

      resources :cohorts, except: [:show] do
        member do
          get :assignment
        end
        resources :friend_cohort_assignments, only: [:create, :update, :destroy]
      end

      get 'reports/new', to: 'reports#new'
      post 'reports/create', to: 'reports#create'
    end

    namespace :accompaniment_leader do
      resources :friends, only: [:show] do
        resources :activities, controller: 'friends/activities', only: [:new, :create]
      end
      resources :activities, only: [:index] do
        resources :accompaniment_reports, except: [:index, :show, :destroy]
      end
    end
  end

  namespace :regional_admin do
    devise_for :users, only: [:invitations], controllers: { invitations: "invitations" }

    resources :regions, only: [] do
      resources :communities, except: [:show, :destroy]
      resources :friends, only: [:index, :show, :update] do
        resources :applications, only: [] do
          get :close
        end
      end
    end
    resources :remote_lawyers, except: [:new, :create, :show]
  end

  namespace :remote_clinic do
    resources :friends, only: [:index, :show] do
      resources :releases, only: [:new, :create, :destroy]
    end
  end

	match '/404', to: 'errors#not_found', via: :all
	match '/500', to: 'errors#internal_server_error', via: :all
{'fraction_non_alphanumeric': 0.11173656065296932, 'fraction_numerical': 0.0016887137630171687, 'mean_word_length': 2.744467860906217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1406625', 'n_tokens_mistral': 2208, 'n_tokens_neox': 2117, 'n_words': 652}