BigW Consortium Gitlab

users_star_project.rb 261 Bytes
Newer Older
Ciro Santilli committed
1
class UsersStarProject < ActiveRecord::Base
2
  belongs_to :project, counter_cache: :star_count, touch: true
Ciro Santilli committed
3 4 5 6 7 8
  belongs_to :user

  validates :user, presence: true
  validates :user_id, uniqueness: { scope: [:project_id] }
  validates :project, presence: true
end