From 9915c10bcfbd12e849813d52937d5ec9805790d8 Mon Sep 17 00:00:00 2001 From: wyx <414722560@qq.com> Date: Sat, 25 Jul 2020 11:21:44 +0800 Subject: [PATCH] update model user --- app/models/user.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e7b2cbc1..0ad5f541 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -99,7 +99,11 @@ class User < ApplicationRecord has_many :stopped_sponsored, class_name: 'StoppedSponsorship', foreign_key: 'developer_id', dependent: :destroy has_many :sponsor_tier, dependent: :destroy has_one :wallet, dependent: :destroy - # has_many :waitlist + has_many :waitlist, class_name: 'Waitlist', foreign_key: 'reviewer_id', optional: true + has_many :passed_waitlist, class_name: 'PassedWaitlist', foreign_key: 'reviewer_id', optional: true #as reviewer + has_one :application, class_name: 'Waitlist', foreign_key: 'applicant_id', optional: true + has_one :passed_application, class_name: 'PassedWaitlist', foreign_key: 'applicant_id', optional: true + # Groups and active users scope :active, lambda { where(status: STATUS_ACTIVE) }