-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove default values from foreign keys
- Loading branch information
Showing
6 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class RemoveDefaultValues < ActiveRecord::Migration[7.0] | ||
def change | ||
change_column_default(:adopter_accounts, :user_id, nil) | ||
change_column_default(:staff_accounts, :organization_id, nil) | ||
change_column_default(:staff_accounts, :user_id, nil) | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,9 @@ class Organizations::InviteStaffTest < ActionDispatch::IntegrationTest | |
end | ||
|
||
test "staff admin can invite other staffs to the organization" do | ||
sign_in create(:user, :staff_admin) | ||
admin = create(:user, :staff_admin) | ||
sign_in admin | ||
set_organization(admin.organization) | ||
|
||
post( | ||
user_invitation_path, | ||
|
@@ -32,7 +34,9 @@ class Organizations::InviteStaffTest < ActionDispatch::IntegrationTest | |
end | ||
|
||
test "staff admin can not invite existing user to the organization" do | ||
sign_in create(:user, :staff_admin) | ||
admin = create(:user, :staff_admin) | ||
sign_in admin | ||
set_organization(admin.organization) | ||
_existing_user = create(:user, email: "[email protected]") | ||
|
||
post( | ||
|