debian-mirror-gitlab/app/models/achievements/achievement.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
487 B
Ruby
Raw Normal View History

2023-03-04 22:38:38 +05:30
# 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