gitlab-org--gitlab-foss/app/models/users_star_project.rb
2016-06-03 11:10:17 +02:00

8 lines
261 B
Ruby

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