<commit_before>class MemberType < ActiveRecord::Base

  # my bone dry solution to search, sort and paginate
  include SearchSortPaginate

  validates :projected_members, numericality: { greater_than_or_equal_to: 0, only_integer: true }
  validates :maximum_members, numericality: { greater_than_or_equal_to: 0, only_integer: true }
  validates :min_price_in_cents, numericality: { greater_than_or_equal_to: 0, only_integer: true }
  validates :max_price_in_cents, numericality: { greater_than_or_equal_to: 0, only_integer: true }

  # we have a polymorphic relationship with notes
  has_many :notes, :as => :asset
  has_many :members

  %w(min max).each do |str|
    # defines two setters:
    # min_price=
    # max_price=
    # this is used by formtastic

    price_setter = "#{str}_price=".to_sym
    define_method price_setter do |num|
      if num.present?
        instance_variable_set("@new_#{str}_price", num)
      end
      instance_variable_set("@changed_#{str}_price", num.present?)
    end

    # defines the accessors for the decimal price
    # min_price<commit_msg>Align those hashes<commit_after>class MemberType < ActiveRecord::Base

  # my bone dry solution to search, sort and paginate
  include SearchSortPaginate

  validates :projected_members,  numericality: { greater_than_or_equal_to: 0, only_integer: true }
  validates :maximum_members,    numericality: { greater_than_or_equal_to: 0, only_integer: true }
  validates :min_price_in_cents, numericality: { greater_than_or_equal_to: 0, only_integer: true }
  validates :max_price_in_cents, numericality: { greater_than_or_equal_to: 0, only_integer: true }

  # we have a polymorphic relationship with notes
  has_many :notes, :as => :asset
  has_many :members

  %w(min max).each do |str|
    # defines two setters:
    # min_price=
    # max_price=
    # this is used by formtastic

    price_setter = "#{str}_price=".to_sym
    define_method price_setter do |num|
      if num.present?
        instance_variable_set("@new_#{str}_price", num)
      end
      instance_variable_set("@changed_#{str}_price", num.present?)
    end

    # defines the accessors for the decimal price
    # min_price
{'fraction_non_alphanumeric': 0.08751727314601566, 'fraction_numerical': 0.0036849378166743437, 'mean_word_length': 4.310513447432763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3795648', 'n_tokens_mistral': 724, 'n_tokens_neox': 697, 'n_words': 183}