Welcome to mirror list, hosted at ThFree Co, Russian Federation.

achievement.rb « achievements « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 904961491b54225d130414d0bb08f95ef574e9b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Achievements
  class Achievement < ApplicationRecord
    include Avatarable
    include StripAttribute

    belongs_to :namespace, inverse_of: :achievements, optional: false

    strip_attributes! :name, :description

    validates :name,
              presence: true,
              length: { maximum: 255 },
              uniqueness: { case_sensitive: false, scope: [:namespace_id] }
    validates :description, length: { maximum: 1024 }
  end
end