gitlab-org--gitlab-foss/app/models/users_star_project.rb

9 lines
261 B
Ruby
Raw Normal View History

2014-06-26 03:49:14 -04:00
class UsersStarProject < ActiveRecord::Base
belongs_to :project, counter_cache: :star_count, touch: true
2014-06-26 03:49:14 -04:00
belongs_to :user
validates :user, presence: true
validates :user_id, uniqueness: { scope: [:project_id] }
validates :project, presence: true
end