<commit_before>class NestedParamsFormBuilder < ActionView::Helpers::FormBuilder
  def fields_for(record_or_name_or_array, *args, &block)
    if record_or_name_or_array.is_a?(String) || record_or_name_or_array.is_a?(Symbol)
      # Is this reflecting bad speed wise? And is there an alternative?
      if reflection = @object.class.reflect_on_all_associations.detect { |r| r.name == record_or_name_or_array.to_sym }
        if reflection.macro == :has_many
          record = args.first
          # In the case of a new object use a fictive id which is composited with "new_" and the object_id.
          name = "#{object_name}[#{record_or_name_or_array}][#{ record.new_record? ? "new_#{record.object_id}" : record.id}]"
          # TODO: We also need to pass the options along without the record instance.
          return @template.fields_for(name, args.first, &block)
        end<commit_msg>Pass the original args on to the call to @template.fields_for<commit_after>class NestedParamsFormBuilder < ActionView::Helpers::FormBuilder
  def fields_for(record_or_name_or_array, *args, &block)
    if record_or_name_or_array.is_a?(String) || record_or_name_or_array.is_a?(Symbol)
      # Is this reflecting bad speed wise? And is there an alternative?
      if reflection = @object.class.reflect_on_all_associations.detect { |r| r.name == record_or_name_or_array.to_sym }
        if reflection.macro == :has_many
          record = args.first
          # In the case of a new object use a fictive id which is composited with "new_" and the object_id.
          name = "#{object_name}[#{record_or_name_or_array}][#{ record.new_record? ? "new_#{record.object_id}" : record.id}]"
          return @template.fields_for(name, *args, &block)
        end
{'fraction_non_alphanumeric': 0.10040160642570281, 'fraction_numerical': 0.0, 'mean_word_length': 3.8579387186629526, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6528891', 'n_tokens_mistral': 546, 'n_tokens_neox': 551, 'n_words': 143}