Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
ruby '~> 3.3'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.2.3.1'
gem 'rails', '~> 8.1.0'

# Use postgres for all env dbs
gem 'pg'
Expand Down
151 changes: 76 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,79 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.2.3.1)
actionpack (= 7.2.3.1)
activesupport (= 7.2.3.1)
action_text-trix (2.1.19)
railties
actioncable (8.1.3)
actionpack (= 8.1.3)
activesupport (= 8.1.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.3.1)
actionpack (= 7.2.3.1)
activejob (= 7.2.3.1)
activerecord (= 7.2.3.1)
activestorage (= 7.2.3.1)
activesupport (= 7.2.3.1)
actionmailbox (8.1.3)
actionpack (= 8.1.3)
activejob (= 8.1.3)
activerecord (= 8.1.3)
activestorage (= 8.1.3)
activesupport (= 8.1.3)
mail (>= 2.8.0)
actionmailer (7.2.3.1)
actionpack (= 7.2.3.1)
actionview (= 7.2.3.1)
activejob (= 7.2.3.1)
activesupport (= 7.2.3.1)
actionmailer (8.1.3)
actionpack (= 8.1.3)
actionview (= 8.1.3)
activejob (= 8.1.3)
activesupport (= 8.1.3)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.3.1)
actionview (= 7.2.3.1)
activesupport (= 7.2.3.1)
cgi
actionpack (8.1.3)
actionview (= 8.1.3)
activesupport (= 8.1.3)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.3)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.3.1)
actionpack (= 7.2.3.1)
activerecord (= 7.2.3.1)
activestorage (= 7.2.3.1)
activesupport (= 7.2.3.1)
actiontext (8.1.3)
action_text-trix (~> 2.1.15)
actionpack (= 8.1.3)
activerecord (= 8.1.3)
activestorage (= 8.1.3)
activesupport (= 8.1.3)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.3.1)
activesupport (= 7.2.3.1)
actionview (8.1.3)
activesupport (= 8.1.3)
builder (~> 3.1)
cgi
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.3.1)
activesupport (= 7.2.3.1)
activejob (8.1.3)
activesupport (= 8.1.3)
globalid (>= 0.3.6)
activemodel (7.2.3.1)
activesupport (= 7.2.3.1)
activerecord (7.2.3.1)
activemodel (= 7.2.3.1)
activesupport (= 7.2.3.1)
activemodel (8.1.3)
activesupport (= 8.1.3)
activerecord (8.1.3)
activemodel (= 8.1.3)
activesupport (= 8.1.3)
timeout (>= 0.4.0)
activestorage (7.2.3.1)
actionpack (= 7.2.3.1)
activejob (= 7.2.3.1)
activerecord (= 7.2.3.1)
activesupport (= 7.2.3.1)
activestorage (8.1.3)
actionpack (= 8.1.3)
activejob (= 8.1.3)
activerecord (= 8.1.3)
activesupport (= 8.1.3)
marcel (~> 1.0)
activesupport (7.2.3.1)
activesupport (8.1.3)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1, < 6)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
annotaterb (4.23.0)
Expand All @@ -87,7 +88,6 @@ GEM
axe-core-rspec (4.12.0)
axe-core-api (= 4.12.0)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (4.1.2)
bindex (0.8.1)
blazer (3.4.0)
Expand Down Expand Up @@ -115,7 +115,6 @@ GEM
capybara-screenshot (1.0.27)
capybara (>= 1.0, < 4)
launchy
cgi (0.5.2)
chartkick (5.2.1)
childprocess (5.1.0)
logger (~> 1.5)
Expand All @@ -127,7 +126,7 @@ GEM
crack (1.0.1)
bigdecimal
rexml
crass (1.0.6)
crass (1.0.7)
csv (3.3.5)
cucumber (10.2.0)
base64 (~> 0.2)
Expand Down Expand Up @@ -203,7 +202,7 @@ GEM
sassc (~> 2.0)
formatador (1.2.3)
reline
globalid (1.3.0)
globalid (1.4.0)
activesupport (>= 6.1)
guard (2.20.1)
formatador (>= 0.2.4)
Expand Down Expand Up @@ -279,19 +278,21 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.4.2)
mail (2.9.0)
mail (2.9.1)
logger
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.1.0)
marcel (1.2.1)
matrix (0.4.3)
memoist3 (1.0.0)
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.9)
minitest (5.27.0)
minitest (6.0.6)
drb (~> 2.0)
prism (~> 1.5)
msgpack (1.8.3)
multi_test (1.1.0)
multi_xml (0.8.1)
Expand Down Expand Up @@ -363,9 +364,6 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
reline (>= 0.6.0)
psych (5.4.0)
date
stringio
public_suffix (7.0.5)
puma (8.0.2)
nio4r (~> 2.0)
Expand All @@ -385,20 +383,20 @@ GEM
rack (>= 1.0.0)
rackup (2.3.1)
rack (>= 3)
rails (7.2.3.1)
actioncable (= 7.2.3.1)
actionmailbox (= 7.2.3.1)
actionmailer (= 7.2.3.1)
actionpack (= 7.2.3.1)
actiontext (= 7.2.3.1)
actionview (= 7.2.3.1)
activejob (= 7.2.3.1)
activemodel (= 7.2.3.1)
activerecord (= 7.2.3.1)
activestorage (= 7.2.3.1)
activesupport (= 7.2.3.1)
rails (8.1.3)
actioncable (= 8.1.3)
actionmailbox (= 8.1.3)
actionmailer (= 8.1.3)
actionpack (= 8.1.3)
actiontext (= 8.1.3)
actionview (= 8.1.3)
activejob (= 8.1.3)
activemodel (= 8.1.3)
activerecord (= 8.1.3)
activestorage (= 8.1.3)
activesupport (= 8.1.3)
bundler (>= 1.15.0)
railties (= 7.2.3.1)
railties (= 8.1.3)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -410,10 +408,9 @@ GEM
rails-html-sanitizer (1.7.0)
loofah (~> 2.25)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.2.3.1)
actionpack (= 7.2.3.1)
activesupport (= 7.2.3.1)
cgi
railties (8.1.3)
actionpack (= 8.1.3)
activesupport (= 8.1.3)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand All @@ -425,9 +422,14 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (7.2.0)
rbs (4.0.3)
logger
prism (>= 1.6.0)
tsort
rdoc (8.0.0)
erb
psych (>= 4.0.0)
prism (>= 1.6.0)
rbs (>= 4.0.0)
tsort
regexp_parser (2.12.0)
reline (0.6.3)
Expand Down Expand Up @@ -537,7 +539,6 @@ GEM
sprockets (>= 3.0.0)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.2.0)
strong_migrations (2.8.0)
activerecord (>= 7.2)
sys-uname (1.5.1)
Expand Down Expand Up @@ -575,7 +576,7 @@ GEM
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket (1.2.11)
websocket-driver (0.8.0)
websocket-driver (0.8.2)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -628,7 +629,7 @@ DEPENDENCIES
pg
puma (>= 6.0)
rack_session_access
rails (~> 7.2.3.1)
rails (~> 8.1.0)
rails-controller-testing (~> 1.0)
rspec-rails
rspec-retry
Expand Down
34 changes: 18 additions & 16 deletions app/controllers/course_settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,24 @@ def reset_email_templates
end

def course_settings_params
params.require(:course_settings).permit(
:enable_extensions,
:auto_approve_days,
:auto_approve_extended_request_days,
:max_auto_approve,
:enable_min_hours_before_deadline,
:min_hours_before_deadline,
:enable_gradescope,
:gradescope_course_url,
:extend_late_due_date,
:enable_emails,
:reply_email,
:email_subject,
:email_template,
:enable_slack_webhook_url,
:slack_webhook_url
params.expect(
course_settings: [
:enable_extensions,
:auto_approve_days,
:auto_approve_extended_request_days,
:max_auto_approve,
:enable_min_hours_before_deadline,
:min_hours_before_deadline,
:enable_gradescope,
:gradescope_course_url,
:extend_late_due_date,
:enable_emails,
:reply_email,
:email_subject,
:email_template,
:enable_slack_webhook_url,
:slack_webhook_url
]
)
end

Expand Down
10 changes: 6 additions & 4 deletions app/controllers/form_settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ def update
private

def form_setting_params
params.require(:form_setting).permit(
:reason_desc, :documentation_desc, :documentation_disp,
:custom_q1, :custom_q1_desc, :custom_q1_disp,
:custom_q2, :custom_q2_desc, :custom_q2_disp
params.expect(
form_setting: [
:reason_desc, :documentation_desc, :documentation_disp,
:custom_q1, :custom_q1_desc, :custom_q1_disp,
:custom_q2, :custom_q2_desc, :custom_q2_disp
]
)
end

Expand Down
14 changes: 6 additions & 8 deletions app/controllers/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def create_for_student

def update
Request.merge_date_and_time!(params[:request])
@request.assign_attributes(update_request_params)
@request.assign_attributes(request_params)
return unless ensure_assignment_in_course

if @request.save
Expand Down Expand Up @@ -187,14 +187,12 @@ def set_form_settings
@form_settings = @course.form_setting
end

# The assignment is chosen at creation and is not editable afterwards, so the
# update action is not permitted to write assignment_id; other actions may.
def request_params
params.require(:request).permit(:assignment_id, :reason, :documentation, :custom_q1, :custom_q2, :requested_due_date)
end

# The assignment is chosen at creation and is not editable afterwards, so it
# is dropped from the params an update is allowed to write.
def update_request_params
request_params.except(:assignment_id)
permitted = [ :reason, :documentation, :custom_q1, :custom_q2, :requested_due_date ]
permitted.unshift(:assignment_id) unless action_name == 'update'
params.expect(request: permitted)
end

# Every request must reference an assignment in this course. A new request
Expand Down
5 changes: 5 additions & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

# Base class for all application mailers.
class ApplicationMailer < ActionMailer::Base
end
Loading
Loading