summaryrefslogtreecommitdiff
path: root/app/models/users_star_project.rb
blob: 0dfe597317e3617b8045262acbccda9a8bdd0cdd (plain)
1
2
3
4
5
6
7
8
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