50abbd3e53
Partially addresses #47424.
10 lines
292 B
Ruby
10 lines
292 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UsersStarProject < ActiveRecord::Base
|
|
belongs_to :project, counter_cache: :star_count, touch: true
|
|
belongs_to :user
|
|
|
|
validates :user, presence: true
|
|
validates :user_id, uniqueness: { scope: [:project_id] }
|
|
validates :project, presence: true
|
|
end
|