<commit_before># frozen_string_literal: true

module GobiertoCommon
  class Vocabulary < ApplicationRecord
    belongs_to :site
    has_many :terms, dependent: :destroy

    validates :site, :name, presence: true
  end
end<commit_msg>Include slug and name translations concerns in GobiertoCommon::Vocabulary model<commit_after># frozen_string_literal: true

module GobiertoCommon
  class Vocabulary < ApplicationRecord
    include GobiertoCommon::Sluggable

    belongs_to :site
    has_many :terms, dependent: :destroy

    validates :site, :name, :slug, presence: true
    validates :slug, uniqueness: { scope: :site_id }

    translates :name

    def attributes_for_slug
      [name]
    end
  end
end
{'fraction_non_alphanumeric': 0.06808510638297872, 'fraction_numerical': 0.0, 'mean_word_length': 4.348484848484849, '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': '6069461', 'n_tokens_mistral': 217, 'n_tokens_neox': 211, 'n_words': 63}