-
Notifications
You must be signed in to change notification settings - Fork 129
added new columns and migrated it to the database #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 9.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.1.4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,9 @@ class UnitsApi < Grape::API | |
| optional :teaching_period_id, type: Integer | ||
| optional :start_date, type: Date | ||
| optional :end_date, type: Date | ||
| optional :creditpoint, type: Integer | ||
| optional :prerequisite, type: String | ||
| optional :corequisite, type: String | ||
|
Comment on lines
+79
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| optional :main_convenor_id, type: Integer | ||
| optional :auto_apply_extension_before_deadline, type: Boolean, desc: 'Indicates if extensions before the deadline should be automatically applied' | ||
| optional :send_notifications, type: Boolean, desc: 'Indicates if emails should be sent on updates each week' | ||
|
|
@@ -117,7 +120,11 @@ class UnitsApi < Grape::API | |
| :extension_weeks_on_resubmit_request, | ||
| :allow_student_change_tutorial, | ||
| :overseer_image_id, | ||
| :assessment_enabled) | ||
| :assessment_enabled, | ||
| :creditpoint, | ||
| :prerequisite, | ||
| :corequisite | ||
| ) | ||
|
|
||
| if unit.teaching_period_id.present? && (unit_parameters.key?(:start_date) || unit_parameters['teaching_period_id'] == -1) | ||
| unit.teaching_period = nil | ||
|
|
@@ -151,10 +158,13 @@ class UnitsApi < Grape::API | |
| optional :teaching_period_id, type: Integer | ||
| optional :start_date, type: Date | ||
| optional :end_date, type: Date | ||
| optional :creditpoint, type: Integer | ||
| optional :prerequisite, type: String | ||
| optional :corequisite, type: String | ||
| optional :main_convenor_user_id, type: Integer | ||
| optional :auto_apply_extension_before_deadline, type: Boolean, desc: 'Indicates if extensions before the deadline should be automatically applied', default: true | ||
| optional :send_notifications, type: Boolean, desc: 'Indicates if emails should be sent on updates each week', default: true | ||
| optional :enable_sync_timetable, type: Boolean, desc: 'Sync to timetable automatically if supported by deployment', default: true | ||
| optional :enable_sync_timetable, type: Boolean, desc: 'Sync to timetable automatically if supported by deployment', default: true | ||
| optional :enable_sync_enrolments, type: Boolean, desc: 'Sync student enrolments automatically if supported by deployment', default: true | ||
| optional :allow_student_extension_requests, type: Boolean, desc: 'Can turn on/off student extension requests', default: true | ||
| optional :extension_weeks_on_resubmit_request, type: Integer, desc: 'Determines the number of weeks extension on a resubmit request', default: 1 | ||
|
|
@@ -188,6 +198,9 @@ class UnitsApi < Grape::API | |
| :extension_weeks_on_resubmit_request, | ||
| :portfolio_auto_generation_date, | ||
| :allow_student_change_tutorial, | ||
| :creditpoint, | ||
| :prerequisite, | ||
| :corequisite | ||
| ) | ||
|
|
||
| # Identify main convenor - ensure they have the correct role | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class AddCreditPointsToUnits < ActiveRecord::Migration[7.1] | ||
| def change | ||
| add_column :units, :creditpoint, :integer | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class AddPrerequisiteToUnits < ActiveRecord::Migration[7.1] | ||
| def change | ||
| add_column :units, :prerequisite, :string | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| class AddCorequisiteToUnits < ActiveRecord::Migration[7.1] | ||
| def change | ||
| add_column :units, :corequisite, :string | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| class SetDefaultForCorequisiteAndPrerequisiteInUnits < ActiveRecord::Migration[7.1] | ||
| def change | ||
| change_column_default :units, :corequisite, from: nil, to: "Nil" | ||
| change_column_default :units, :prerequisite, from: nil, to: "Nil" | ||
|
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should probably remain in the code