<commit_before># ## Schema Information
#
# Table name: `profiles`
#
# ### Columns
#
# Name                    | Type               | Attributes
# ----------------------- | ------------------ | ---------------------------
# **`id`**                | `integer`          | `not null, primary key`
# **`name`**              | `string`           |
# **`bio`**               | `text`             |
# **`work_company`**      | `string`           |
# **`work_title`**        | `string`           |
# **`location`**          | `string`           |
# **`twitter_username`**  | `string`           |
# **`rate`**              | `decimal(, )`      | `default(0.0), not null`
# **`created_at`**        | `datetime`         | `not null`
# **`updated_at`**        | `datetime`         | `not null`
# **`user_id`**           | `integer`          |
#
# ### Indexes
#
# * `index_profiles_on_twitter_username`:
#     * **`twitter_username`**
# * `index_profiles_on_user_id`:
#     * **`user_id`**
#
# ### Foreign Keys
#
# * `fk_rails_e424190865`:
#     * **`user_id => users.id`**
#

class Profile < ApplicationRecord
  belongs_to :user
  validates :rate_email,
            numericality: { greater_than_or_equal_to: 0 }

  validates :rate_sms,
            numericality: { greater_than_or_equal_to: 0 }

  before_validation :set_defaults

  private

  def set_defaults
    self.rate_email ||= 0
    self.rate_sms ||= 0
  end
end<commit_msg>Remove mailboxer helpers<commit_after># ## Schema Information
#
# Table name: `profiles`
#
# ### Columns
#
# Name                    | Type               | Attributes
# ----------------------- | ------------------ | ---------------------------
# **`id`**                | `integer`          | `not null, primary key`
# **`name`**              | `string`           |
# **`bio`**               | `text`             |
# **`work_company`**      | `string`           |
# **`work_title`**        | `string`           |
# **`location`**          | `string`           |
# **`twitter_username`**  | `string`           |
# **`rate`**              | `decimal(, )`      | `default(0.0), not null`
# **`created_at`**        | `datetime`         | `not null`
# **`updated_at`**        | `datetime`         | `not null`
# **`user_id`**           | `integer`          |
#
# ### Indexes
#
# * `index_profiles_on_twitter_username`:
#     * **`twitter_username`**
# * `index_profiles_on_user_id`:
#     * **`user_id`**
#
# ### Foreign Keys
#
# * `fk_rails_e424190865`:
#     * **`user_id => users.id`**
#

class Profile < ApplicationRecord
  before_validation :set_defaults

  belongs_to :user

  validates :rate,
            numericality: { greater_than_or_equal_to: 0 }

  private

  def set_defaults
    self.rate ||= 0
  end
end
{'fraction_non_alphanumeric': 0.22035139092240116, 'fraction_numerical': 0.010248901903367497, 'mean_word_length': 1.6585603112840468, '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': '4513999', 'n_tokens_mistral': 919, 'n_tokens_neox': 891, 'n_words': 152}