Skip to content
Draft
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 @@ -41,7 +41,7 @@ gem 'propshaft'
gem 'puma', '~> 7.2'
gem 'rack_content_type_default', '~> 1.1'
gem 'rack-cors'
gem 'rails', '~> 7.1'
gem 'rails', '~> 8.1'
gem 'ruby-progressbar', '~> 1.13', require: false
gem 'sentry-rails'
gem 'statesman'
Expand Down
124 changes: 61 additions & 63 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,79 +11,80 @@ GIT
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.18)
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)
administrate (1.0.0)
Expand Down Expand Up @@ -116,7 +117,6 @@ GEM
aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (4.1.1)
bootsnap (1.23.0)
msgpack (~> 1.2)
Expand All @@ -136,7 +136,6 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
cgi (0.5.1)
childprocess (4.1.0)
choice (0.2.0)
climate_control (1.2.0)
Expand Down Expand Up @@ -379,20 +378,20 @@ GEM
rack
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-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -405,10 +404,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 Down Expand Up @@ -617,7 +615,7 @@ DEPENDENCIES
puma (~> 7.2)
rack-cors
rack_content_type_default (~> 1.1)
rails (~> 7.1)
rails (~> 8.1)
rails-erd
rspec
rspec-rails
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/class_members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def members_existing_in_profile
end

def class_member_params
params.require(:class_member).permit(:user_id, :type)
params.expect(class_member: %i[user_id type])
end

def create_batch_params
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/google_auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def response_error_message
def google_token_params
params.require(:google_auth).require(:code)
params.require(:google_auth).require(:redirect_uri)
params.require(:google_auth).permit(:code, :redirect_uri)
params.expect(google_auth: %i[code redirect_uri])
end
end
end
24 changes: 13 additions & 11 deletions app/controllers/api/projects/remixes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ def load_and_authorize_remix
end

def remix_params
params.require(:project)
.permit(:name,
:identifier,
:project_type,
:locale,
:user_id,
:videos,
:audio,
:instructions,
image_list: [],
components: %i[id name extension content index])
params
.expect(project: [:name,
:identifier,
:project_type,
:locale,
:user_id,
:videos,
:audio,
:instructions,
{
image_list: [],
components: [%i[id name extension content index]]
}])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/school_classes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ def load_and_authorize_school_class

def school_class_params
# A school teacher may only create classes they own.
params.require(:school_class).permit(:name, :description)
params.expect(school_class: %i[name description])
end

def import_school_class_params
params.require(:school_class).permit(:name, :description, :import_origin, :import_id)
params.expect(school_class: %i[name description import_origin import_id])
end

def import_school_students_params
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/school_students_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def remove_students(student_ids)
end

def school_student_params
params.require(:school_student).permit(:username, :password, :name)
params.expect(school_student: %i[username password name])
end

def school_students_params
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/school_teachers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def create
private

def school_teacher_params
params.require(:school_teacher).permit(:email_address)
params.expect(school_teacher: [:email_address])
end
end
end
40 changes: 20 additions & 20 deletions app/controllers/api/schools_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,26 @@ def import
private

def school_params
params.require(:school).permit(
:name,
:website,
:reference,
:district_name,
:district_nces_id,
:school_roll_number,
:address_line_1,
:address_line_2,
:municipality,
:administrative_area,
:postal_code,
:country_code,
:creator_role,
:creator_department,
:creator_agree_authority,
:creator_agree_terms_and_conditions,
:creator_agree_to_ux_contact,
:creator_agree_responsible_safeguarding,
:user_origin
params.expect(
school: %i[name
website
reference
district_name
district_nces_id
school_roll_number
address_line_1
address_line_2
municipality
administrative_area
postal_code
country_code
creator_role
creator_department
creator_agree_authority
creator_agree_terms_and_conditions
creator_agree_to_ux_contact
creator_agree_responsible_safeguarding
user_origin]
)
end
end
Expand Down
2 changes: 2 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env ruby
exec "./bin/rails", "server", *ARGV
8 changes: 8 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

# explicit rubocop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))

load Gem.bin_path("rubocop", "rubocop")
23 changes: 11 additions & 12 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "fileutils"

require 'fileutils'

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args, exception: true)
Expand All @@ -15,21 +12,23 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.

puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "== Installing dependencies =="
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end

puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
system! "bin/rails db:prepare"

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! 'bin/rails restart'
unless ARGV.include?("--skip-server")
puts "\n== Starting development server =="
STDOUT.flush # flush the output before exec(2) so that it displays
exec "bin/dev"
end
end
Loading
Loading