<commit_before>module Autotune
  class Group < ActiveRecord::Base
    has_many :themes
    has_and_belongs_to_many :blueprints
    has_many :group_memberships
    has_many :users, through: :group_memberships

    # TODO (Kavya) add validations
  end
end<commit_msg>add validations to group<commit_after>module Autotune
  class Group < ActiveRecord::Base
    include Slugged
    has_many :themes
    has_and_belongs_to_many :projects
    has_many :group_memberships
    has_many :users, through: :group_memberships

    validates :slug, :name, :presence => true
    validates :name,
              :uniqueness => true
    validates :slug,
              :uniqueness => true,
              :format => { :with => /\A[0-9a-z\-_]+\z/ }
  end
end
{'fraction_non_alphanumeric': 0.08943089430894309, 'fraction_numerical': 0.0027100271002710027, 'mean_word_length': 3.1055555555555556, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '2984722', 'n_tokens_mistral': 248, 'n_tokens_neox': 240, 'n_words': 58}