Feature/update confirmation email information (#145)
* Add `invited_by` foreign key to User Allows for a User to be tied to the user who invited them * Include `current_user` in new agent initialization parameters * Add `shoulda-matchers` for testing associations * Add Inviter information and associated account to welcome email * Only show inviter info if applicable * Update conversation spec for FFaker compatibility
This commit is contained in:
5
db/migrate/20191014051743_add_invited_by_to_user.rb
Normal file
5
db/migrate/20191014051743_add_invited_by_to_user.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddInvitedByToUser < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_reference(:users, :inviter, foreign_key: { to_table: :users })
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_08_19_010457) do
|
||||
ActiveRecord::Schema.define(version: 2019_10_14_051743) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -205,9 +205,12 @@ ActiveRecord::Schema.define(version: 2019_08_19_010457) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "channel"
|
||||
t.integer "role", default: 0
|
||||
t.bigint "inviter_id"
|
||||
t.index ["email"], name: "index_users_on_email"
|
||||
t.index ["inviter_id"], name: "index_users_on_inviter_id"
|
||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||
t.index ["uid", "provider"], name: "index_users_on_uid_and_provider", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "users", "users", column: "inviter_id"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user