2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-05-18 00:54:41 +05:30
|
|
|
class UsersStarProject < ApplicationRecord
|
2015-12-23 02:04:40 +05:30
|
|
|
belongs_to :project, counter_cache: :star_count, touch: true
|
2014-09-02 18:07:02 +05:30
|
|
|
belongs_to :user
|
|
|
|
|
|
|
|
validates :user, presence: true
|
|
|
|
validates :user_id, uniqueness: { scope: [:project_id] }
|
|
|
|
validates :project, presence: true
|
|
|
|
end
|