diff --git a/app/models/user.rb b/app/models/user.rb index f919ed1b..e7b2cbc1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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| diff --git a/db/migrate/20200724095001_create_waitlists.rb b/db/migrate/20200725025555_create_waitlists.rb similarity index 56% rename from db/migrate/20200724095001_create_waitlists.rb rename to db/migrate/20200725025555_create_waitlists.rb index d0df8a23..701006e9 100644 --- a/db/migrate/20200724095001_create_waitlists.rb +++ b/db/migrate/20200725025555_create_waitlists.rb @@ -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 diff --git a/db/migrate/20200724095057_create_passed_waitlists.rb b/db/migrate/20200725025657_create_passed_waitlists.rb similarity index 100% rename from db/migrate/20200724095057_create_passed_waitlists.rb rename to db/migrate/20200725025657_create_passed_waitlists.rb