<commit_before>class PossiblePage
  def self.matches?(request)
    path = request.params[:page_path].to_s
    count = Page.active.where(:path => "/" + path).count
    0 < count
  end
end

Rails.application.routes.draw do
  
  constraints(
    :year  => /\d{4}/,
    :month => /\d{1,2}/,
    :day   => /\d{1,2}/
  ) do 
    get '/blog/:year(/:month)(/:day)' => 'posts#index', :as => :post_date
    get '/blog/:year/:month/:day/:id' => 'posts#show',  :as => :full_post
  end
  
  get '/blog/search/:query', :to => 'posts#search', :as => :search_posts, :query => /.*/
      
  resources :posts, :path => 'blog' do
    get :archive, :on => :collection
  end
  
  namespace :admin do
  
    post "/markdown/preview" => "markdown#preview"
  
    resources :pages do
      post :update_positions, :on => :collection
      resources :contents do
        post :update_positions, :on => :collection
      end
    end
    
    resources :posts do 
      resources :images,   :controller => "post_images"
      resources :products, :controller => "post_products"
    end
    
    resources :uploads
    
  end

  constraints(PossiblePage) do
    get '(:page_path)' => 'pages#show', :page_path => /(?!(account|cart|login|products|users|t)).*/
  end
  
end<commit_msg>added more routes to the filter.. must have been late haha<commit_after>class PossiblePage
  def self.matches?(request)
    path = request.params[:page_path].to_s
    count = Page.active.where(:path => "/" + path).count
    0 < count
  end
end

Rails.application.routes.draw do
  
  constraints(
    :year  => /\d{4}/,
    :month => /\d{1,2}/,
    :day   => /\d{1,2}/
  ) do 
    get '/blog/:year(/:month)(/:day)' => 'posts#index', :as => :post_date
    get '/blog/:year/:month/:day/:id' => 'posts#show',  :as => :full_post
  end
  
  get '/blog/search/:query', :to => 'posts#search', :as => :search_posts, :query => /.*/
      
  resources :posts, :path => 'blog' do
    get :archive, :on => :collection
  end
  
  namespace :admin do
  
    post "/markdown/preview" => "markdown#preview"
  
    resources :pages do
      post :update_positions, :on => :collection
      resources :contents do
        post :update_positions, :on => :collection
      end
    end
    
    resources :posts do 
      resources :images,   :controller => "post_images"
      resources :products, :controller => "post_products"
    end
    
    resources :uploads
    
  end

  constraints(PossiblePage) do
    get '(:page_path)' => 'pages#show', :page_path => /(?!(admin|account|cart|checkout|content|login|products|t|users)).*/
  end
  
end
{'fraction_non_alphanumeric': 0.16809006211180125, 'fraction_numerical': 0.004658385093167702, 'mean_word_length': 2.740203193033382, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '7413368', 'n_tokens_mistral': 882, 'n_tokens_neox': 877, 'n_words': 203}