mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 13:46:11 +10:00
9 lines
261 B
Ruby
9 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
|