<commit_before># == Schema Information
#
# Table name: tags
#
#  id                       :integer          not null, primary key
#  name                     :string(255)
#  slug                     :string(255)
#  category_id              :integer
#  purity                   :string(255)
#  coined_by_id             :integer
#  approved_by_id           :integer
#  approved_at              :datetime
#  sfw_wallpapers_count     :integer          default(0)
#  sketchy_wallpapers_count :integer          default(0)
#  nsfw_wallpapers_count    :integer          default(0)
#

class Tag < ActiveRecord::Base
  belongs_to :category, counter_cache: true
  belongs_to :coined_by, class_name: 'User'

  has_many :wallpapers_tags, dependent: :destroy
  has_many :wallpapers, through: :wallpapers_tags

  delegate :name, to: :category, prefix: true, allow_nil: true

  include Approvable<commit_msg>Remove category counter cache on Tag model<commit_after># == Schema Information
#
# Table name: tags
#
#  id                       :integer          not null, primary key
#  name                     :string(255)
#  slug                     :string(255)
#  category_id              :integer
#  purity                   :string(255)
#  coined_by_id             :integer
#  approved_by_id           :integer
#  approved_at              :datetime
#  sfw_wallpapers_count     :integer          default(0)
#  sketchy_wallpapers_count :integer          default(0)
#  nsfw_wallpapers_count    :integer          default(0)
#

class Tag < ActiveRecord::Base
  belongs_to :category
  belongs_to :coined_by, class_name: 'User'

  has_many :wallpapers_tags, dependent: :destroy
  has_many :wallpapers, through: :wallpapers_tags

  delegate :name, to: :category, prefix: true, allow_nil: true

  include Approvable
{'fraction_non_alphanumeric': 0.08035714285714286, 'fraction_numerical': 0.013392857142857142, 'mean_word_length': 2.196078431372549, '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': '6565679', 'n_tokens_mistral': 561, 'n_tokens_neox': 524, 'n_words': 131}