GRN2-253: Added the ability to share rooms across multiple users (#912)

* Added ability to share rooms with other users

* Fixed testcases
This commit is contained in:
Ahmad Farhat
2020-01-23 09:04:41 -05:00
committed by farhatahmad
parent 8cbfc3f730
commit 967130e57c
36 changed files with 748 additions and 55 deletions

View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
class CreateSharedAccesses < ActiveRecord::Migration[5.2]
def change
create_table :shared_accesses do |t|
t.belongs_to :room, foreign_key: true
t.references :user, foreign_key: true
t.timestamps
end
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_10_23_172511) do
ActiveRecord::Schema.define(version: 2019_11_28_212935) do
create_table "features", force: :cascade do |t|
t.integer "setting_id"
@ -90,6 +90,15 @@ ActiveRecord::Schema.define(version: 2019_10_23_172511) do
t.index ["provider"], name: "index_settings_on_provider"
end
create_table "shared_accesses", force: :cascade do |t|
t.integer "room_id"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["room_id"], name: "index_shared_accesses_on_room_id"
t.index ["user_id"], name: "index_shared_accesses_on_user_id"
end
create_table "users", force: :cascade do |t|
t.integer "room_id"
t.string "provider"