Browse Source

update table waitlist and passed_waitlist

tags/v1
wyx 6 years ago
parent
commit
c546eda537
3 changed files with 13 additions and 2 deletions
  1. +9
    -0
      app/models/user.rb
  2. +4
    -2
      db/migrate/20200725025555_create_waitlists.rb
  3. +0
    -0
      db/migrate/20200725025657_create_passed_waitlists.rb

+ 9
- 0
app/models/user.rb View File

@@ -92,6 +92,15 @@ class User < ApplicationRecord
# has_many :libraries, dependent: :destroy
has_many :project_trends, dependent: :destroy

# sponsor
has_many :as_sponsors, class_name: 'Sponsorship', foreign_key: 'sponsor_id', dependent: :destroy
has_many :as_sponsored, class_name: 'Sponsorship', foreign_key: 'developer_id', dependent: :destroy
has_many :stopped_sponsors, class_name: 'StoppedSponsorship', foreign_key: 'sponsor_id', dependent: :destroy
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

# Groups and active users
scope :active, lambda { where(status: STATUS_ACTIVE) }
scope :like, lambda { |keywords|


db/migrate/20200724095001_create_waitlists.rb → db/migrate/20200725025555_create_waitlists.rb View File

@@ -1,8 +1,10 @@
class CreateWaitlists < ActiveRecord::Migration[5.2]
def change
create_table :waitlists do |t|
t.integer :applicant_id
t.integer :reviewer_id
t.string :applicant_id
t.string :integer
t.string :reviewer_id
t.string :integer

t.timestamps
end

db/migrate/20200724095057_create_passed_waitlists.rb → db/migrate/20200725025657_create_passed_waitlists.rb View File


Loading…
Cancel
Save