<commit_before>class ReddeFormBuilder < ActionView::Helpers::FormBuilder
  delegate :render, :content_tag, :tag, :link_to, to: :@template

  def redde_field(name, *args)
    label(name)
    case object.class.columns.detect { |column| column.name == name.to_s }.type
    when :text then redde_text_area(name, *args)
    when :boolean then redde_check_box(name, *args)
    else
      redde_text_field(name, *args)
    end
  end

  # TODO: разобоаться с options
  def redde_select(name, *args)
    # options = args.extract_options!
    content_tag :tr, class: options[:wrapper_class] do
      content_tag(:th, smart_label(name)) + content_tag(:td, select(name, *args))
    end
  end

  def redde_check_box(name, *args)
    options = args.extract_options!
    content_tag :tr, class: options[:wrapper_class] do
      content_tag :th, colspan: 2 do
         check_box(name, options) + " " + smart_label(name)
      end
    end
  end

  def redde_text_field(name, *args)
    options = args.extract_options!<commit_msg>Added datetime_select<commit_after>class ReddeFormBuilder < ActionView::Helpers::FormBuilder
  delegate :render, :content_tag, :tag, :link_to, to: :@template

  def redde_field(name, *args)
    label(name)
    case object.class.columns.detect { |column| column.name == name.to_s }.type
    when :text then redde_text_area(name, *args)
    when :boolean then redde_check_box(name, *args)
    else
      redde_text_field(name, *args)
    end
  end

  # TODO: разобоаться с options
  def redde_select(name, *args)
    # options = args.extract_options!
    content_tag :tr, class: options[:wrapper_class] do
      content_tag(:th, smart_label(name)) + content_tag(:td, select(name, *args))
    end
  end

  def redde_date_time(name, *args)
    options = args.extract_options!
    content_tag :tr, class: options[:wrapper_class] do
      content_tag(:th, smart_label(name)) + content_tag(:td, datetime_select(name, options))
    end
  end

  def redde_check_box(name, *args)
    options = args.extract_options!
    content_tag :tr, class: options[:wrapper_class] do
      content_tag :th, colspan: 2 do
         check_box(name, options) + " " + smart_label(name)
      end
    end
  end

  def redde_text_field(name, *args)
    options = args.extract_options!
{'fraction_non_alphanumeric': 0.11253309796999117, 'fraction_numerical': 0.00088261253309797, 'mean_word_length': 3.8752688172043013, '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': '1996291', 'n_tokens_mistral': 782, 'n_tokens_neox': 770, 'n_words': 181}