<commit_before>class PortfolioController < ApplicationController
  unloadable

  layout 'portfolio'

  if Portfolio::Redmine.public_access?
    skip_before_filter :user_setup, :check_if_login_required, :check_password_change, :only => :index
  end

  def index
    @projects = Project.portfolio
  end
end<commit_msg>Avoid public_access to be cached on the controller<commit_after>class PortfolioController < ApplicationController
  unloadable

  layout 'portfolio'

  PRIVATE_ACCESS = [
    :user_setup,
    :check_if_login_required,
    :check_password_change
  ]

  skip_before_filter *PRIVATE_ACCESS, :only => :index
  before_filter :public_access?, :only => :index

  def index
    @projects = Project.portfolio
  end

  protected
    def public_access?
      PRIVATE_ACCESS.map{ |v| send(v) }.all? unless Portfolio::Redmine.public_access?
    end
end
{'fraction_non_alphanumeric': 0.0783625730994152, 'fraction_numerical': 0.0, 'mean_word_length': 4.594771241830065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '1068452', 'n_tokens_mistral': 274, 'n_tokens_neox': 263, 'n_words': 61}