jbox-web/redmine_git_hosting

View on GitHub
app/models/repository_git_config_key/git_config.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class RepositoryGitConfigKey::GitConfig < RepositoryGitConfigKey
  VALID_CONFIG_KEY_REGEX = /\A[a-zA-Z0-9]+\.[a-zA-Z0-9.]+\z/

  validates :key, presence: true,
                  uniqueness: { case_sensitive: false, scope: %i[type repository_id] },
                  format: { with: VALID_CONFIG_KEY_REGEX }
end