<commit_before>module ToyLocomotive::Attributes
  class AttributeChain

    attr_accessor :column, :parent, :_as, :_helper

    def initialize column, parent
      @column = column
      @parent = parent
      @_as = :string
    end

    def as value
      @_as = value
      self
    end

    def presence bool
      parent.send :validates_presence_of, column
      self
    end

    def uniqueness value
      return parent.send :validates_uniqueness_of, column if value == true
      parent.send :validates_uniqueness_of, column, {scope: value}
      self
    end

    def helper value
      @_helper = value
      self
    end

    def to_helper
      return @_helper if @_helper
      return :text_area if @_as == :text
      return :hidden_field if @column == :id || @column.to_s[-3..-1] == '_id'
      :text_field
    end

  end
end<commit_msg>add attributes selection<commit_after>module ToyLocomotive::Attributes
  class AttributeChain

    attr_accessor :column, :parent, :_as, :_helper

    def initialize column, parent
      @column = column
      @parent = parent
      @_as = :string
    end

    def as value
      @_as = value
      self
    end

    def presence bool
      parent.send :validates_presence_of, column
      self
    end

    def uniqueness value
      return parent.send :validates_uniqueness_of, column if value == true
      parent.send :validates_uniqueness_of, column, {scope: value}
      self
    end

    def helper value
      @_helper = value
      self
    end

    def to_helper
      return @_helper if @_helper
      return :text_area if @_as == :text
      return :hidden_field if @column == :id || @column.to_s[-3..-1] == '_id'
      return :check_box if @column == :id || @column._as == :boolean
      :text_field
    end

  end
end
{'fraction_non_alphanumeric': 0.08080808080808081, 'fraction_numerical': 0.002244668911335578, 'mean_word_length': 2.326492537313433, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1772278', 'n_tokens_mistral': 560, 'n_tokens_neox': 541, 'n_words': 170}