forked from capability-boosters-dev/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop gender and birthdate columns from User
Test Plan: -specs should pass flag=none fixes VICE-591 Change-Id: I20595e1f7aefe8e4c6237db60b3eac9139780fef Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242087 Tested-by: Service Cloud Jenkins <[email protected]> Reviewed-by: Rob Orton <[email protected]> QA-Review: Rob Orton <[email protected]> Product-Review: Rob Orton <[email protected]>
- Loading branch information
1 parent
0e96dba
commit 079860e
Showing
4 changed files
with
33 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Copyright (C) 2020 - present Instructure, Inc. | ||
# | ||
# This file is part of Canvas. | ||
# | ||
# Canvas is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU Affero General Public License as published by the Free | ||
# Software Foundation, version 3 of the License. | ||
# | ||
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License along | ||
# with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
class DropUnusedUserColumns < ActiveRecord::Migration[5.2] | ||
tag :postdeploy | ||
|
||
def change | ||
remove_column :users, :gender, :string, limit: 255 | ||
remove_column :users, :birthdate, :datetime | ||
end | ||
end |
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 |
---|---|---|
|
@@ -1297,13 +1297,6 @@ def create_user_skip_cc_confirm(admin_user) | |
end | ||
end | ||
|
||
it "should catch invalid dates before passing to the database" do | ||
json = api_call(:post, "/api/v1/accounts/#{@site_admin.account.id}/users", | ||
{ :controller => 'users', :action => 'create', :format => 'json', :account_id => @site_admin.account.id.to_s }, | ||
{ :pseudonym => { :unique_id => "[email protected]"}, | ||
:user => { :name => "Test User", :birthdate => "-3587-11-20" } }, {}, {:expected_status => 400} ) | ||
end | ||
|
||
it "should allow site admins to create users and auto-validate communication channel" do | ||
create_user_skip_cc_confirm(@site_admin) | ||
end | ||
|
@@ -1627,7 +1620,6 @@ def create_user_skip_cc_confirm(admin_user) | |
'time_zone' => "Tijuana" | ||
}) | ||
|
||
expect(user.birthdate.to_date).to eq birthday.getutc.to_date | ||
expect(user.time_zone.name).to eql 'Tijuana' | ||
end | ||
|
||
|
@@ -1691,20 +1683,6 @@ def create_user_skip_cc_confirm(admin_user) | |
expect(user.profile.reload.title).to eq another_title | ||
end | ||
|
||
it "should catch invalid dates" do | ||
birthday = Time.now | ||
json = api_call(:put, @path, @path_options, { | ||
:user => { | ||
:name => 'Tobias Funke', | ||
:short_name => 'Tobias', | ||
:sortable_name => 'Funke, Tobias', | ||
:time_zone => 'Tijuana', | ||
:birthdate => "-4000-02-01 10:20", | ||
:locale => 'en' | ||
} | ||
}, {}, {:expected_status => 400}) | ||
end | ||
|
||
it "should allow updating without any params" do | ||
json = api_call(:put, @path, @path_options, {}) | ||
expect(json).not_to be_nil | ||
|