debian-mirror-gitlab/app/models/users_star_project.rb
2019-07-07 11:18:12 +05:30

10 lines
291 B
Ruby

# frozen_string_literal: true
class UsersStarProject < ApplicationRecord
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