<commit_before>module Formulate
  module FormHelper
    FIELD_ERROR_PROC = proc { |html_tag, instance_tag| html_tag }

    def form_for(record, options={}, &proc)
      options[:html] ||= {}
      apply_form_for_options!(record, options)
      options[:html][:class] << ' formulate'
      options[:html][:class] << " #{options[:class]}" if options[:class]

      original_field_error_proc = ::ActionView::Base.field_error_proc
      ::ActionView::Base.field_error_proc = FIELD_ERROR_PROC
      super
    ensure
      ::ActionView::Base.field_error_proc = original_field_error_proc
    end
  end
end<commit_msg>Fix form helper for forms without a real record.<commit_after>module Formulate
  module FormHelper
    FIELD_ERROR_PROC = proc { |html_tag, instance_tag| html_tag }

    def form_for(record, options={}, &proc)
      options[:html] ||= {}

      case record
      when String, Symbol
        options[:html][:class] ||= ''
      else
        apply_form_for_options!(record, options)
      end

      options[:html][:class] << ' formulate'
      options[:html][:class] << " #{options[:class]}" if options[:class]
      options[:html][:class].strip!

      original_field_error_proc = ::ActionView::Base.field_error_proc
      ::ActionView::Base.field_error_proc = FIELD_ERROR_PROC
      super
    ensure
      ::ActionView::Base.field_error_proc = original_field_error_proc
    end
  end
end
{'fraction_non_alphanumeric': 0.12374821173104435, 'fraction_numerical': 0.0, 'mean_word_length': 3.6946308724832213, 'pattern_counts': {'":': 0, '<': 11, '<?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': '491388', 'n_tokens_mistral': 434, 'n_tokens_neox': 423, 'n_words': 82}