<commit_before>class FormTemplateColumn < ActiveRecord::Base
  FIELD_TYPES = [[''], ['Select','select']]

  serialize :options
  attr_accessor :selected
  acts_as_list :scope => :form_template_id
  before_save :set_options
  default_scope :order => 'position asc'
  belongs_to :form_template
  validates_presence_of :name, :sql_type
  validates_presence_of :field_options, :if => Proc.new { |record| record.field_type == 'select' }

  def human_name
    ActiveRecord::Base.human_attribute_name(name)
  end

  def after_initialize
    self.options ||= { 'field_type' => nil, 'field_options' => nil, 'field_required' => false }
  end

  def field_options
    @field_options ||= options['field_options']
  end

  def field_options=(value)
    @field_options = value
  end

  def field_required
    ActiveRecord::ConnectionAdapters::Column.value_to_boolean(@field_required ||= options['field_required'])
  end

  def field_required=(value)
    @field_required = value.to_s
  end

  def field_type
    @field_type ||= options['field_type']
  end

  def field_type=(value)<commit_msg>another type issue with false vs. 'false'<commit_after>class FormTemplateColumn < ActiveRecord::Base
  FIELD_TYPES = [[''], ['Select','select']]

  serialize :options
  attr_accessor :selected
  acts_as_list :scope => :form_template_id
  before_save :set_options
  default_scope :order => 'position asc'
  belongs_to :form_template
  validates_presence_of :name, :sql_type
  validates_presence_of :field_options, :if => Proc.new { |record| record.field_type == 'select' }

  def human_name
    ActiveRecord::Base.human_attribute_name(name)
  end

  def after_initialize
    self.options ||= { 'field_type' => nil, 'field_options' => nil, 'field_required' => 'false' }
  end

  def field_options
    @field_options ||= options['field_options']
  end

  def field_options=(value)
    @field_options = value
  end

  def field_required
    ActiveRecord::ConnectionAdapters::Column.value_to_boolean(@field_required ||= options['field_required'])
  end

  def field_required=(value)
    @field_required = value.to_s
  end

  def field_type
    @field_type ||= options['field_type']
  end

  def field_type=(value)
{'fraction_non_alphanumeric': 0.11390667886550777, 'fraction_numerical': 0.0, 'mean_word_length': 4.910810810810811, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1352298', 'n_tokens_mistral': 725, 'n_tokens_neox': 700, 'n_words': 147}