<commit_before>module CaptchaExtensions
  extend ActiveSupport::Concern

  included do
    attr_accessor :valid_recaptcha
    validate :captcha, :if => Proc.new { |f| f.new_record? }
  end
  
  def captcha
    return if current_user && current_user.preverified?

    if self.valid_recaptcha.nil?
      self.errors.add(:base, "Captcha failed. Please try again.")
    end
  end
end<commit_msg>Skip captcha check if running in development mode<commit_after>module CaptchaExtensions
  extend ActiveSupport::Concern

  included do
    attr_accessor :valid_recaptcha
    validate :captcha, :if => Proc.new { |f| f.new_record? }
  end

  def captcha
    return if current_user.try(:preverified?)
    return if Rails.env.development?

    if self.valid_recaptcha.nil?
      self.errors.add(:base, "Captcha failed. Please try again.")
    end
  end
end
{'fraction_non_alphanumeric': 0.08778173190984578, 'fraction_numerical': 0.0, 'mean_word_length': 3.612021857923497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6782625', 'n_tokens_mistral': 280, 'n_tokens_neox': 266, 'n_words': 72}