From 601853f60a79b3c548a5cb46dfd88b3297d2b89d Mon Sep 17 00:00:00 2001 From: thekeenant Date: Fri, 23 Feb 2018 03:52:58 -0600 Subject: [PATCH] Initial commit --- .gitignore | 20 + .idea/encodings.xml | 6 + .idea/madgrades.com.iml | 9 + .idea/misc.xml | 58 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 1517 +++++++++++++++++ Gemfile | 40 + Gemfile.lock | 180 ++ README.md | 24 + Rakefile | 6 + app/controllers/application_controller.rb | 9 + app/controllers/concerns/.keep | 0 .../course_offerings_controller.rb | 9 + app/controllers/courses_controller.rb | 14 + .../grade_distributions_controller.rb | 5 + app/controllers/instructors_controller.rb | 74 + app/controllers/rooms_controller.rb | 2 + app/controllers/schedules_controller.rb | 2 + app/controllers/sections_controller.rb | 74 + app/jobs/application_job.rb | 2 + app/mailers/application_mailer.rb | 4 + app/models/application_record.rb | 3 + app/models/concerns/.keep | 0 app/models/course.rb | 25 + app/models/course_offering.rb | 40 + app/models/grade_distribution.rb | 59 + app/models/instructor.rb | 11 + app/models/room.rb | 7 + app/models/schedule.rb | 38 + app/models/section.rb | 31 + app/models/teaching.rb | 9 + .../_course_offering.json.jbuilder | 5 + .../course_offerings/index.json.jbuilder | 1 + app/views/course_offerings/show.json.jbuilder | 1 + app/views/courses/_course.json.jbuilder | 6 + app/views/courses/index.json.jbuilder | 4 + app/views/courses/show.json.jbuilder | 1 + .../_grade_distribution.json.jbuilder | 1 + .../grade_distributions/show.json.jbuilder | 1 + .../instructors/_instructor.json.jbuilder | 2 + app/views/instructors/index.json.jbuilder | 1 + app/views/instructors/show.json.jbuilder | 4 + app/views/rooms/_room.json.jbuilder | 1 + app/views/schedules/_schedule.json.jbuilder | 4 + app/views/sections/_section.json.jbuilder | 18 + app/views/sections/index.json.jbuilder | 1 + app/views/sections/show.json.jbuilder | 1 + bin/bundle | 3 + bin/rails | 4 + bin/rake | 4 + bin/setup | 38 + bin/update | 29 + bin/yarn | 11 + config.ru | 5 + config/application.rb | 18 + config/boot.rb | 3 + config/cable.yml | 10 + config/database.yml | 54 + config/environment.rb | 5 + config/environments/development.rb | 54 + config/environments/production.rb | 91 + config/environments/test.rb | 42 + .../application_controller_renderer.rb | 6 + config/initializers/assets.rb | 14 + config/initializers/backtrace_silencers.rb | 7 + config/initializers/cookies_serializer.rb | 5 + .../initializers/filter_parameter_logging.rb | 4 + config/initializers/inflections.rb | 16 + config/initializers/kaminari_config.rb | 12 + config/initializers/mime_types.rb | 4 + config/initializers/wrap_parameters.rb | 14 + config/locales/en.yml | 33 + config/puma.rb | 56 + config/routes.rb | 8 + config/secrets.yml | 32 + config/spring.rb | 6 + db/migrate/20180223033008_create_courses.rb | 9 + .../20180223033451_create_course_offerings.rb | 11 + ...180223033651_create_grade_distributions.rb | 24 + .../20180223033741_create_instructors.rb | 8 + db/migrate/20180223033800_create_rooms.rb | 9 + db/migrate/20180223033822_create_schedules.rb | 16 + db/migrate/20180223033951_create_sections.rb | 11 + db/migrate/20180223034017_create_teachings.rb | 8 + db/schema.rb | 101 ++ db/seeds.rb | 7 + lib/assets/.keep | 0 lib/tasks/.keep | 0 lib/tasks/import.rake | 81 + log/.keep | 0 package.json | 5 + public/404.html | 67 + public/422.html | 67 + public/500.html | 66 + public/apple-touch-icon-precomposed.png | 0 public/apple-touch-icon.png | 0 public/favicon.ico | 0 public/robots.txt | 1 + test/application_system_test_case.rb | 5 + test/controllers/.keep | 0 .../course_offerings_controller_test.rb | 48 + test/controllers/courses_controller_test.rb | 48 + .../grade_distributions_controller_test.rb | 48 + .../instructors_controller_test.rb | 48 + test/controllers/rooms_controller_test.rb | 48 + test/controllers/schedules_controller_test.rb | 48 + test/controllers/sections_controller_test.rb | 48 + test/controllers/teachings_controller_test.rb | 48 + test/fixtures/.keep | 0 test/fixtures/course_offerings.yml | 15 + test/fixtures/courses.yml | 11 + test/fixtures/files/.keep | 0 test/fixtures/grade_distributions.yml | 41 + test/fixtures/instructors.yml | 9 + test/fixtures/rooms.yml | 11 + test/fixtures/schedules.yml | 23 + test/fixtures/sections.yml | 15 + test/fixtures/teachings.yml | 9 + test/helpers/.keep | 0 test/integration/.keep | 0 test/mailers/.keep | 0 test/models/.keep | 0 test/models/course_offering_test.rb | 7 + test/models/course_test.rb | 7 + test/models/grade_distribution_test.rb | 7 + test/models/instructor_test.rb | 7 + test/models/room_test.rb | 7 + test/models/schedule_test.rb | 7 + test/models/section_test.rb | 7 + test/models/teaching_test.rb | 7 + test/system/.keep | 0 test/system/course_offerings_test.rb | 9 + test/system/courses_test.rb | 9 + test/system/grade_distributions_test.rb | 9 + test/system/instructors_test.rb | 9 + test/system/rooms_test.rb | 9 + test/system/schedules_test.rb | 9 + test/system/sections_test.rb | 9 + test/system/teachings_test.rb | 9 + test/test_helper.rb | 9 + vendor/.keep | 0 142 files changed, 4083 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/madgrades.com.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.md create mode 100644 Rakefile create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/concerns/.keep create mode 100644 app/controllers/course_offerings_controller.rb create mode 100644 app/controllers/courses_controller.rb create mode 100644 app/controllers/grade_distributions_controller.rb create mode 100644 app/controllers/instructors_controller.rb create mode 100644 app/controllers/rooms_controller.rb create mode 100644 app/controllers/schedules_controller.rb create mode 100644 app/controllers/sections_controller.rb create mode 100644 app/jobs/application_job.rb create mode 100644 app/mailers/application_mailer.rb create mode 100644 app/models/application_record.rb create mode 100644 app/models/concerns/.keep create mode 100644 app/models/course.rb create mode 100644 app/models/course_offering.rb create mode 100644 app/models/grade_distribution.rb create mode 100644 app/models/instructor.rb create mode 100644 app/models/room.rb create mode 100644 app/models/schedule.rb create mode 100644 app/models/section.rb create mode 100644 app/models/teaching.rb create mode 100644 app/views/course_offerings/_course_offering.json.jbuilder create mode 100644 app/views/course_offerings/index.json.jbuilder create mode 100644 app/views/course_offerings/show.json.jbuilder create mode 100644 app/views/courses/_course.json.jbuilder create mode 100644 app/views/courses/index.json.jbuilder create mode 100644 app/views/courses/show.json.jbuilder create mode 100644 app/views/grade_distributions/_grade_distribution.json.jbuilder create mode 100644 app/views/grade_distributions/show.json.jbuilder create mode 100644 app/views/instructors/_instructor.json.jbuilder create mode 100644 app/views/instructors/index.json.jbuilder create mode 100644 app/views/instructors/show.json.jbuilder create mode 100644 app/views/rooms/_room.json.jbuilder create mode 100644 app/views/schedules/_schedule.json.jbuilder create mode 100644 app/views/sections/_section.json.jbuilder create mode 100644 app/views/sections/index.json.jbuilder create mode 100644 app/views/sections/show.json.jbuilder create mode 100755 bin/bundle create mode 100755 bin/rails create mode 100755 bin/rake create mode 100755 bin/setup create mode 100755 bin/update create mode 100755 bin/yarn create mode 100644 config.ru create mode 100644 config/application.rb create mode 100644 config/boot.rb create mode 100644 config/cable.yml create mode 100644 config/database.yml create mode 100644 config/environment.rb create mode 100644 config/environments/development.rb create mode 100644 config/environments/production.rb create mode 100644 config/environments/test.rb create mode 100644 config/initializers/application_controller_renderer.rb create mode 100644 config/initializers/assets.rb create mode 100644 config/initializers/backtrace_silencers.rb create mode 100644 config/initializers/cookies_serializer.rb create mode 100644 config/initializers/filter_parameter_logging.rb create mode 100644 config/initializers/inflections.rb create mode 100644 config/initializers/kaminari_config.rb create mode 100644 config/initializers/mime_types.rb create mode 100644 config/initializers/wrap_parameters.rb create mode 100644 config/locales/en.yml create mode 100644 config/puma.rb create mode 100644 config/routes.rb create mode 100644 config/secrets.yml create mode 100644 config/spring.rb create mode 100644 db/migrate/20180223033008_create_courses.rb create mode 100644 db/migrate/20180223033451_create_course_offerings.rb create mode 100644 db/migrate/20180223033651_create_grade_distributions.rb create mode 100644 db/migrate/20180223033741_create_instructors.rb create mode 100644 db/migrate/20180223033800_create_rooms.rb create mode 100644 db/migrate/20180223033822_create_schedules.rb create mode 100644 db/migrate/20180223033951_create_sections.rb create mode 100644 db/migrate/20180223034017_create_teachings.rb create mode 100644 db/schema.rb create mode 100644 db/seeds.rb create mode 100644 lib/assets/.keep create mode 100644 lib/tasks/.keep create mode 100644 lib/tasks/import.rake create mode 100644 log/.keep create mode 100644 package.json create mode 100644 public/404.html create mode 100644 public/422.html create mode 100644 public/500.html create mode 100644 public/apple-touch-icon-precomposed.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon.ico create mode 100644 public/robots.txt create mode 100644 test/application_system_test_case.rb create mode 100644 test/controllers/.keep create mode 100644 test/controllers/course_offerings_controller_test.rb create mode 100644 test/controllers/courses_controller_test.rb create mode 100644 test/controllers/grade_distributions_controller_test.rb create mode 100644 test/controllers/instructors_controller_test.rb create mode 100644 test/controllers/rooms_controller_test.rb create mode 100644 test/controllers/schedules_controller_test.rb create mode 100644 test/controllers/sections_controller_test.rb create mode 100644 test/controllers/teachings_controller_test.rb create mode 100644 test/fixtures/.keep create mode 100644 test/fixtures/course_offerings.yml create mode 100644 test/fixtures/courses.yml create mode 100644 test/fixtures/files/.keep create mode 100644 test/fixtures/grade_distributions.yml create mode 100644 test/fixtures/instructors.yml create mode 100644 test/fixtures/rooms.yml create mode 100644 test/fixtures/schedules.yml create mode 100644 test/fixtures/sections.yml create mode 100644 test/fixtures/teachings.yml create mode 100644 test/helpers/.keep create mode 100644 test/integration/.keep create mode 100644 test/mailers/.keep create mode 100644 test/models/.keep create mode 100644 test/models/course_offering_test.rb create mode 100644 test/models/course_test.rb create mode 100644 test/models/grade_distribution_test.rb create mode 100644 test/models/instructor_test.rb create mode 100644 test/models/room_test.rb create mode 100644 test/models/schedule_test.rb create mode 100644 test/models/section_test.rb create mode 100644 test/models/teaching_test.rb create mode 100644 test/system/.keep create mode 100644 test/system/course_offerings_test.rb create mode 100644 test/system/courses_test.rb create mode 100644 test/system/grade_distributions_test.rb create mode 100644 test/system/instructors_test.rb create mode 100644 test/system/rooms_test.rb create mode 100644 test/system/schedules_test.rb create mode 100644 test/system/sections_test.rb create mode 100644 test/system/teachings_test.rb create mode 100644 test/test_helper.rb create mode 100644 vendor/.keep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..857b316 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +*.csv +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +/node_modules +/yarn-error.log + +.byebug_history diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/madgrades.com.iml b/.idea/madgrades.com.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/madgrades.com.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..e344801 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..cd70ba7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..877176a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,1517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + setsS + t + time + timestamps + asset + as + ass + jbui + get + assets + I + INNER + IN + INNER JOIN + \nunless params\[\:hide_urls\] + j + json + json. + json.ur + json.url + + + $PROJECT_DIR$/config + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1519356048311 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..c7c1ba3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,40 @@ +source 'https://rubygems.org' + +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" +end + +gem 'kaminari' + +gem 'jbuilder' + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.1.3' +# Use mysql as the database for Active Record +gem 'mysql2', '>= 0.3.18', '< 0.5' +# Use Puma as the app server +gem 'puma', '~> 3.7' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '~> 2.13' + gem 'selenium-webdriver' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..93fe457 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,180 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.1.5) + actionpack (= 5.1.5) + nio4r (~> 2.0) + websocket-driver (~> 0.6.1) + actionmailer (5.1.5) + actionpack (= 5.1.5) + actionview (= 5.1.5) + activejob (= 5.1.5) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.1.5) + actionview (= 5.1.5) + activesupport (= 5.1.5) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.1.5) + activesupport (= 5.1.5) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.1.5) + activesupport (= 5.1.5) + globalid (>= 0.3.6) + activemodel (5.1.5) + activesupport (= 5.1.5) + activerecord (5.1.5) + activemodel (= 5.1.5) + activesupport (= 5.1.5) + arel (~> 8.0) + activesupport (5.1.5) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + arel (8.0.0) + bindex (0.5.0) + builder (3.2.3) + byebug (10.0.0) + capybara (2.18.0) + addressable + mini_mime (>= 0.1.3) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (>= 2.0, < 4.0) + childprocess (0.8.0) + ffi (~> 1.0, >= 1.0.11) + concurrent-ruby (1.0.5) + crass (1.0.3) + erubi (1.7.0) + ffi (1.9.22) + globalid (0.4.1) + activesupport (>= 4.2.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jbuilder (2.7.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + kaminari (1.0.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.0.1) + kaminari-activerecord (= 1.0.1) + kaminari-core (= 1.0.1) + kaminari-actionview (1.0.1) + actionview + kaminari-core (= 1.0.1) + kaminari-activerecord (1.0.1) + activerecord + kaminari-core (= 1.0.1) + kaminari-core (1.0.1) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.2.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + method_source (0.9.0) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + multi_json (1.13.1) + mysql2 (0.4.10) + nio4r (2.2.0) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + public_suffix (3.0.2) + puma (3.11.2) + rack (2.0.4) + rack-test (0.8.2) + rack (>= 1.0, < 3) + rails (5.1.5) + actioncable (= 5.1.5) + actionmailer (= 5.1.5) + actionpack (= 5.1.5) + actionview (= 5.1.5) + activejob (= 5.1.5) + activemodel (= 5.1.5) + activerecord (= 5.1.5) + activesupport (= 5.1.5) + bundler (>= 1.3.0) + railties (= 5.1.5) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.1.5) + actionpack (= 5.1.5) + activesupport (= 5.1.5) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.3.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + ruby_dep (1.5.0) + rubyzip (1.2.1) + selenium-webdriver (3.9.0) + childprocess (~> 0.5) + rubyzip (~> 1.2) + spring (2.0.2) + activesupport (>= 4.2) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.20.0) + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + web-console (3.5.1) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + xpath (3.0.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + capybara (~> 2.13) + jbuilder + kaminari + listen (>= 3.0.5, < 3.2) + mysql2 (>= 0.3.18, < 0.5) + puma (~> 3.7) + rails (~> 5.1.3) + selenium-webdriver + spring + spring-watcher-listen (~> 2.0.0) + tzinfo-data + web-console (>= 3.3.0) + +BUNDLED WITH + 1.14.6 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..e85f913 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..3ac4d2c --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,9 @@ +class ApplicationController < ActionController::Base + protect_from_forgery with: :exception + + before_action :set_json + + def set_json + request.format = :json unless params[:format] + end +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/course_offerings_controller.rb b/app/controllers/course_offerings_controller.rb new file mode 100644 index 0000000..d657e92 --- /dev/null +++ b/app/controllers/course_offerings_controller.rb @@ -0,0 +1,9 @@ +class CourseOfferingsController < ApplicationController + def index + @course_offerings = CourseOffering.all + end + + def show + @course_offering = CourseOffering.find(params[:id]) + end +end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb new file mode 100644 index 0000000..61f7a27 --- /dev/null +++ b/app/controllers/courses_controller.rb @@ -0,0 +1,14 @@ +class CoursesController < ApplicationController + def index + @courses = Course.all.page(params[:page]) + end + + def show + @course = Course.find(params[:id]) + end + + def search + @courses = Course.search(params[:query]).page(params[:page]) + render :index + end +end diff --git a/app/controllers/grade_distributions_controller.rb b/app/controllers/grade_distributions_controller.rb new file mode 100644 index 0000000..3431930 --- /dev/null +++ b/app/controllers/grade_distributions_controller.rb @@ -0,0 +1,5 @@ +class GradeDistributionsController < ApplicationController + def show + @grade_distribution = GradeDistribution.find(params[:id]) + end +end diff --git a/app/controllers/instructors_controller.rb b/app/controllers/instructors_controller.rb new file mode 100644 index 0000000..c31f882 --- /dev/null +++ b/app/controllers/instructors_controller.rb @@ -0,0 +1,74 @@ +class InstructorsController < ApplicationController + before_action :set_instructor, only: [:show, :edit, :update, :destroy] + + # GET /instructors + # GET /instructors.json + def index + @instructors = Instructor.all + end + + # GET /instructors/1 + # GET /instructors/1.json + def show + end + + # GET /instructors/new + def new + @instructor = Instructor.new + end + + # GET /instructors/1/edit + def edit + end + + # POST /instructors + # POST /instructors.json + def create + @instructor = Instructor.new(instructor_params) + + respond_to do |format| + if @instructor.save + format.html { redirect_to @instructor, notice: 'Instructor was successfully created.' } + format.json { render :show, status: :created, location: @instructor } + else + format.html { render :new } + format.json { render json: @instructor.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /instructors/1 + # PATCH/PUT /instructors/1.json + def update + respond_to do |format| + if @instructor.update(instructor_params) + format.html { redirect_to @instructor, notice: 'Instructor was successfully updated.' } + format.json { render :show, status: :ok, location: @instructor } + else + format.html { render :edit } + format.json { render json: @instructor.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /instructors/1 + # DELETE /instructors/1.json + def destroy + @instructor.destroy + respond_to do |format| + format.html { redirect_to instructors_url, notice: 'Instructor was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_instructor + @instructor = Instructor.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def instructor_params + params.require(:instructor).permit(:id, :name) + end +end diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb new file mode 100644 index 0000000..3f1ea82 --- /dev/null +++ b/app/controllers/rooms_controller.rb @@ -0,0 +1,2 @@ +class RoomsController < ApplicationController +end diff --git a/app/controllers/schedules_controller.rb b/app/controllers/schedules_controller.rb new file mode 100644 index 0000000..c9c5681 --- /dev/null +++ b/app/controllers/schedules_controller.rb @@ -0,0 +1,2 @@ +class SchedulesController < ApplicationController +end diff --git a/app/controllers/sections_controller.rb b/app/controllers/sections_controller.rb new file mode 100644 index 0000000..ec8d57b --- /dev/null +++ b/app/controllers/sections_controller.rb @@ -0,0 +1,74 @@ +class SectionsController < ApplicationController + before_action :set_section, only: [:show, :edit, :update, :destroy] + + # GET /sections + # GET /sections.json + def index + @sections = Section.page(params[:page]) + end + + # GET /sections/1 + # GET /sections/1.json + def show + end + + # GET /sections/new + def new + @section = Section.new + end + + # GET /sections/1/edit + def edit + end + + # POST /sections + # POST /sections.json + def create + @section = Section.new(section_params) + + respond_to do |format| + if @section.save + format.html { redirect_to @section, notice: 'Section was successfully created.' } + format.json { render :show, status: :created, location: @section } + else + format.html { render :new } + format.json { render json: @section.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /sections/1 + # PATCH/PUT /sections/1.json + def update + respond_to do |format| + if @section.update(section_params) + format.html { redirect_to @section, notice: 'Section was successfully updated.' } + format.json { render :show, status: :ok, location: @section } + else + format.html { render :edit } + format.json { render json: @section.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /sections/1 + # DELETE /sections/1.json + def destroy + @section.destroy + respond_to do |format| + format.html { redirect_to sections_url, notice: 'Section was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_section + @section = Section.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def section_params + params.require(:section).permit(:uuid, :course_offering_uuid, :number, :section_type, :schedule_uuid) + end +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..a009ace --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..286b223 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..10a4cba --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/course.rb b/app/models/course.rb new file mode 100644 index 0000000..5c258c8 --- /dev/null +++ b/app/models/course.rb @@ -0,0 +1,25 @@ +class Course < ApplicationRecord + self.primary_key = :uuid + + default_scope { order(subject_code: :asc, number: :asc) } + + def self.search(query) + # todo? + Course.select('DISTINCT(courses.uuid), courses.subject_code, courses.number') + .joins("INNER JOIN course_offerings ON course_offerings.course_uuid = courses.uuid") + .where('short_name LIKE ?', "%#{query}%") + end + + def name + # todo + course_offerings.first.name + end + + def course_offerings + CourseOffering.where(course_uuid: uuid) + end + + def to_param + uuid + end +end diff --git a/app/models/course_offering.rb b/app/models/course_offering.rb new file mode 100644 index 0000000..58586a6 --- /dev/null +++ b/app/models/course_offering.rb @@ -0,0 +1,40 @@ +class CourseOffering < ApplicationRecord + self.primary_key = :uuid + + def name + # todo + short_name + end + + def term_name + # get season + season_id = term_code % 10 + term_year = term_code / 10 + + offset = term_year - 101 + + # account for fall season being 1 greater than other seasons + offset -= 1 if season_id == 2 + + calendar_year = 2001 + offset + if season_id == 4 + return "Spring #{calendar_year}" + elsif season_id == 6 + return "Summer #{calendar_year}" + elsif season_id == 2 + return "Fall #{calendar_year}" + end + end + + def course + Course.find(course_uuid) + end + + def sections(id=nil) + Section.where(course_offering_uuid: uuid) + end + + def to_param + uuid + end +end diff --git a/app/models/grade_distribution.rb b/app/models/grade_distribution.rb new file mode 100644 index 0000000..8a207a8 --- /dev/null +++ b/app/models/grade_distribution.rb @@ -0,0 +1,59 @@ +class GradeDistribution < ApplicationRecord + def course_offering + CourseOffering.find(course_offering_uuid) + end + + def course + course_offering.course + end + + def sections + course_offering.sections.where(number: section_number) + end + + def term_code + course_offering.term_code + end + + def term_name + course_offering.term_name + end + + def total + %w(a_count ab_count b_count bc_count c_count d_count f_count).map{|col| self[col]}.sum + end + + def avg + total_counts = total + if total_counts == 0 + return 0 + end + + weighted = 4 * a_count + + 3.5 * ab_count + + 3 * b_count + + 2.5 * bc_count + + 2 * c_count + + 1 * d_count + + 0 * f_count + (4 * weighted / (4 * total_counts)).round(2) + end + + def counts + result = {} + %w(a_count ab_count b_count bc_count c_count d_count f_count).each do |col| + result[col.partition('_').first.upcase] = self[col] + end + result + end + + def percents(scale) + total = total_count + result = counts + result.each{|col, count| result[col] = scale * (count.to_d / total.to_d)} + end + + def course + course_offering.course + end +end diff --git a/app/models/instructor.rb b/app/models/instructor.rb new file mode 100644 index 0000000..25f8f30 --- /dev/null +++ b/app/models/instructor.rb @@ -0,0 +1,11 @@ +class Instructor < ApplicationRecord + self.primary_key = :id + + def teachings + Teaching.where(instructor_id: id) + end + + def sections + Section.where('uuid IN (?)', teachings.map(&:section_uuid)) + end +end diff --git a/app/models/room.rb b/app/models/room.rb new file mode 100644 index 0000000..9b18474 --- /dev/null +++ b/app/models/room.rb @@ -0,0 +1,7 @@ +class Room < ApplicationRecord + self.primary_key = :uuid + + def to_param + uuid + end +end diff --git a/app/models/schedule.rb b/app/models/schedule.rb new file mode 100644 index 0000000..8532788 --- /dev/null +++ b/app/models/schedule.rb @@ -0,0 +1,38 @@ +class Schedule < ApplicationRecord + self.primary_key = :uuid + + def to_param + uuid + end + + def start_time_clock + if start_time > 0 + Time.at(start_time * 60).utc.strftime("%H:%M") + else + nil + end + end + + def end_time_clock + if end_time > 0 + Time.at(end_time * 60).utc.strftime("%H:%M") + else + nil + end + end + + def days + result = '' + result = 'M' if mon + result += 'T' if tues + result += 'W' if wed + result += 'R' if thurs + result += 'F' if fri + result += 'S' if sat + result += 'N' if sun + if result == '' + return nil + end + result + end +end diff --git a/app/models/section.rb b/app/models/section.rb new file mode 100644 index 0000000..9a29562 --- /dev/null +++ b/app/models/section.rb @@ -0,0 +1,31 @@ +class Section < ApplicationRecord + self.primary_key = :uuid + + def to_param + uuid + end + + def term_name + course_offering.term_name + end + + def course_offering + CourseOffering.find(course_offering_uuid) + end + + def course + course_offering.course + end + + def schedule + Schedule.find_by_uuid(schedule_uuid) + end + + def instructors + Teaching.where(section_uuid: uuid).map(&:instructor) + end + + def grade_distribution + GradeDistribution.where(course_offering_uuid: course_offering_uuid, section_number: number).first + end +end diff --git a/app/models/teaching.rb b/app/models/teaching.rb new file mode 100644 index 0000000..6db77b4 --- /dev/null +++ b/app/models/teaching.rb @@ -0,0 +1,9 @@ +class Teaching < ApplicationRecord + def section + Section.find(section_uuid) + end + + def instructor + Instructor.find(instructor_id) + end +end diff --git a/app/views/course_offerings/_course_offering.json.jbuilder b/app/views/course_offerings/_course_offering.json.jbuilder new file mode 100644 index 0000000..9a0bab7 --- /dev/null +++ b/app/views/course_offerings/_course_offering.json.jbuilder @@ -0,0 +1,5 @@ +json.extract! course_offering, :uuid, :course_uuid, :term_code, :name +json.url course_offering_url(course_offering) +json.sections course_offering.sections.each do |section| + json.partial! "sections/section", section: section +end \ No newline at end of file diff --git a/app/views/course_offerings/index.json.jbuilder b/app/views/course_offerings/index.json.jbuilder new file mode 100644 index 0000000..c9fd13e --- /dev/null +++ b/app/views/course_offerings/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @course_offerings, partial: 'course_offerings/course_offering', as: :course_offering diff --git a/app/views/course_offerings/show.json.jbuilder b/app/views/course_offerings/show.json.jbuilder new file mode 100644 index 0000000..da61ed5 --- /dev/null +++ b/app/views/course_offerings/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "course_offerings/course_offering", course_offering: @course_offering diff --git a/app/views/courses/_course.json.jbuilder b/app/views/courses/_course.json.jbuilder new file mode 100644 index 0000000..86ab8dd --- /dev/null +++ b/app/views/courses/_course.json.jbuilder @@ -0,0 +1,6 @@ +json.extract! course, :uuid, :subject_code, :number, :name +json.course_offerings course.course_offerings do |course_offering| + json.uuid course_offering.uuid + json.url course_offering_url(course_offering) +end +json.url course_url(course) \ No newline at end of file diff --git a/app/views/courses/index.json.jbuilder b/app/views/courses/index.json.jbuilder new file mode 100644 index 0000000..3ef61a2 --- /dev/null +++ b/app/views/courses/index.json.jbuilder @@ -0,0 +1,4 @@ +json.page @courses.current_page +json.results do + json.array! @courses, partial: 'courses/course', as: :course +end \ No newline at end of file diff --git a/app/views/courses/show.json.jbuilder b/app/views/courses/show.json.jbuilder new file mode 100644 index 0000000..a85c000 --- /dev/null +++ b/app/views/courses/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "courses/course", course: @course diff --git a/app/views/grade_distributions/_grade_distribution.json.jbuilder b/app/views/grade_distributions/_grade_distribution.json.jbuilder new file mode 100644 index 0000000..6e10bd4 --- /dev/null +++ b/app/views/grade_distributions/_grade_distribution.json.jbuilder @@ -0,0 +1 @@ +json.extract! grade_distribution, :total, :avg, :a_count, :ab_count, :b_count, :bc_count, :c_count, :d_count, :f_count, :s_count, :u_count, :cr_count, :n_count, :p_count, :i_count, :nw_count, :nr_count, :other_count diff --git a/app/views/grade_distributions/show.json.jbuilder b/app/views/grade_distributions/show.json.jbuilder new file mode 100644 index 0000000..863310f --- /dev/null +++ b/app/views/grade_distributions/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "grade_distributions/grade_distribution", grade_distribution: @grade_distribution diff --git a/app/views/instructors/_instructor.json.jbuilder b/app/views/instructors/_instructor.json.jbuilder new file mode 100644 index 0000000..2cd2b2d --- /dev/null +++ b/app/views/instructors/_instructor.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! instructor, :id, :name +json.url instructor_url(instructor) diff --git a/app/views/instructors/index.json.jbuilder b/app/views/instructors/index.json.jbuilder new file mode 100644 index 0000000..1fa6fd3 --- /dev/null +++ b/app/views/instructors/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @instructors, partial: 'instructors/instructor', as: :instructor diff --git a/app/views/instructors/show.json.jbuilder b/app/views/instructors/show.json.jbuilder new file mode 100644 index 0000000..e46ec89 --- /dev/null +++ b/app/views/instructors/show.json.jbuilder @@ -0,0 +1,4 @@ +json.partial! "instructors/instructor", instructor: @instructor +json.sections @instructor.sections do |section| + json.partial! "sections/section", section: section +end \ No newline at end of file diff --git a/app/views/rooms/_room.json.jbuilder b/app/views/rooms/_room.json.jbuilder new file mode 100644 index 0000000..8723fa4 --- /dev/null +++ b/app/views/rooms/_room.json.jbuilder @@ -0,0 +1 @@ +json.extract! room, :uuid, :facility_code, :room_code \ No newline at end of file diff --git a/app/views/schedules/_schedule.json.jbuilder b/app/views/schedules/_schedule.json.jbuilder new file mode 100644 index 0000000..d05d2b3 --- /dev/null +++ b/app/views/schedules/_schedule.json.jbuilder @@ -0,0 +1,4 @@ +json.uuid schedule.uuid +json.start_time schedule.start_time_clock +json.end_time schedule.end_time_clock +json.days schedule.days diff --git a/app/views/sections/_section.json.jbuilder b/app/views/sections/_section.json.jbuilder new file mode 100644 index 0000000..a5a196b --- /dev/null +++ b/app/views/sections/_section.json.jbuilder @@ -0,0 +1,18 @@ +json.uuid section.uuid +json.course_offering_uuid section.course_offering_uuid +json.section_type section.section_type +json.number section.number +json.schedule do + json.partial! "schedules/schedule", schedule: section.schedule +end +json.instructors section.instructors.each do |instructor| + json.partial! "instructors/instructor", instructor: instructor +end +if section.grade_distribution + json.grade_distribution do + json.partial! "grade_distributions/grade_distribution", grade_distribution: section.grade_distribution + end +else + json.grade_distribution nil +end +json.url section_url(section) \ No newline at end of file diff --git a/app/views/sections/index.json.jbuilder b/app/views/sections/index.json.jbuilder new file mode 100644 index 0000000..75beda2 --- /dev/null +++ b/app/views/sections/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @sections, partial: 'sections/section', as: :section diff --git a/app/views/sections/show.json.jbuilder b/app/views/sections/show.json.jbuilder new file mode 100644 index 0000000..5d6e7d8 --- /dev/null +++ b/app/views/sections/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "sections/section", section: @section \ No newline at end of file diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..0739660 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..1724048 --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..78c4e86 --- /dev/null +++ b/bin/setup @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/update b/bin/update new file mode 100755 index 0000000..a8e4462 --- /dev/null +++ b/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/yarn b/bin/yarn new file mode 100755 index 0000000..c2bacef --- /dev/null +++ b/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +VENDOR_PATH = File.expand_path('..', __dir__) +Dir.chdir(VENDOR_PATH) do + begin + exec "yarnpkg #{ARGV.join(" ")}" + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..f7ba0b5 --- /dev/null +++ b/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..6e49a09 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,18 @@ +require_relative 'boot' + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module MadgradesCom + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 5.1 + + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..30f5120 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..5775a69 --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 + channel_prefix: madgrades_com_production diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..7ae2fb5 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,54 @@ +# MySQL. Versions 5.1.10 and up are supported. +# +# Install the MySQL driver +# gem install mysql2 +# +# Ensure the MySQL gem is defined in your Gemfile +# gem 'mysql2' +# +# And be sure to use new-style password hashing: +# http://dev.mysql.com/doc/refman/5.7/en/old-client.html +# +default: &default + adapter: mysql2 + encoding: utf8 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + username: root + password: password + socket: /var/run/mysqld/mysqld.sock + +development: + <<: *default + database: madgrades_com_development + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: madgrades_com_test + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: madgrades_com_production + username: madgrades_com + password: <%= ENV['MADGRADES_COM_DATABASE_PASSWORD'] %> diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..426333b --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..5187e22 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,54 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..37db358 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,91 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Attempt to read encrypted secrets from `config/secrets.yml.enc`. + # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or + # `config/secrets.yml.key`. + config.read_encrypted_secrets = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "madgrades_com_#{Rails.env}" + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..8e5cbde --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000..51639b6 --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,6 @@ +# Be sure to restart your server when you modify this file. + +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..4b828e8 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path +# Add Yarn node_modules folder to the asset load path. +Rails.application.config.assets.paths << Rails.root.join('node_modules') + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..5a6a32d --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb new file mode 100644 index 0000000..c808667 --- /dev/null +++ b/config/initializers/kaminari_config.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true +Kaminari.configure do |config| + # config.default_per_page = 25 + # config.max_per_page = nil + # config.window = 4 + # config.outer_window = 0 + # config.left = 0 + # config.right = 0 + # config.page_method_name = :page + # config.param_name = :page + # config.params_on_first_page = false +end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..bbfc396 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..decc5a8 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# 'true': 'foo' +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..1e19380 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,56 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. If you use this option +# you need to make sure to reconnect any threads in the `on_worker_boot` +# block. +# +# preload_app! + +# If you are preloading your application and using Active Record, it's +# recommended that you close any connections to the database before workers +# are forked to prevent connection leakage. +# +# before_fork do +# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) +# end + +# The code in the `on_worker_boot` will be called if you are using +# clustered mode by specifying a number of `workers`. After each worker +# process is booted, this block will be run. If you are using the `preload_app!` +# option, you will want to use this block to reconnect to any threads +# or connections that may have been created at application boot, as Ruby +# cannot share connections between processes. +# +# on_worker_boot do +# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +# end +# + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..25d9acc --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,8 @@ +Rails.application.routes.draw do + get 'courses/search(/:query)', to: 'courses#search' + resources :courses, only: [:index, :show] + resources :sections, only: [:index, :show] + resources :instructors, only: [:index, :show] + resources :grade_distributions, only: [:show] + resources :course_offerings, only: [:index, :show] +end diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..243446c --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,32 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rails secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +# Shared secrets are available across all environments. + +# shared: +# api_key: a1B2c3D4e5F6 + +# Environmental secrets are only available for that specific environment. + +development: + secret_key_base: 4c44074a0134c0bac114a428a19475f14f3bfa3b2ff793d5d41b1597cf92185e8676cc02a51fac323e97ab0f55a36faedade916d989cfdf19ace17dec5958880 + +test: + secret_key_base: 78e583e8b459811cbbb3e3757a2b757d2717c8bfcf5c203c02533ffe889ce14f3b8e42aab0e1f908ce8d188baa90904bc781f1083a5c0394a98dcad1e5ddaf4d + +# Do not keep production secrets in the unencrypted secrets file. +# Instead, either read values from the environment. +# Or, use `bin/rails secrets:setup` to configure encrypted secrets +# and move the `production:` environment over there. + +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 0000000..c9119b4 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/db/migrate/20180223033008_create_courses.rb b/db/migrate/20180223033008_create_courses.rb new file mode 100644 index 0000000..1c224f5 --- /dev/null +++ b/db/migrate/20180223033008_create_courses.rb @@ -0,0 +1,9 @@ +class CreateCourses < ActiveRecord::Migration[5.1] + def change + create_table :courses, primary_key: :uuid, id: false do |t| + t.string :uuid + t.string :subject_code + t.integer :number + end + end +end diff --git a/db/migrate/20180223033451_create_course_offerings.rb b/db/migrate/20180223033451_create_course_offerings.rb new file mode 100644 index 0000000..eb9a9d8 --- /dev/null +++ b/db/migrate/20180223033451_create_course_offerings.rb @@ -0,0 +1,11 @@ +class CreateCourseOfferings < ActiveRecord::Migration[5.1] + def change + create_table :course_offerings, primary_key: :uuid, id: false do |t| + t.string :uuid + t.string :course_uuid + t.integer :term_code + t.string :name + t.string :short_name + end + end +end diff --git a/db/migrate/20180223033651_create_grade_distributions.rb b/db/migrate/20180223033651_create_grade_distributions.rb new file mode 100644 index 0000000..c9c0e08 --- /dev/null +++ b/db/migrate/20180223033651_create_grade_distributions.rb @@ -0,0 +1,24 @@ +class CreateGradeDistributions < ActiveRecord::Migration[5.1] + def change + create_table :grade_distributions do |t| + t.string :course_offering_uuid + t.string :section_number + t.integer :a_count + t.integer :ab_count + t.integer :b_count + t.integer :bc_count + t.integer :c_count + t.integer :d_count + t.integer :f_count + t.integer :s_count + t.integer :u_count + t.integer :cr_count + t.integer :n_count + t.integer :p_count + t.integer :i_count + t.integer :nw_count + t.integer :nr_count + t.integer :other_count + end + end +end diff --git a/db/migrate/20180223033741_create_instructors.rb b/db/migrate/20180223033741_create_instructors.rb new file mode 100644 index 0000000..0fa605e --- /dev/null +++ b/db/migrate/20180223033741_create_instructors.rb @@ -0,0 +1,8 @@ +class CreateInstructors < ActiveRecord::Migration[5.1] + def change + create_table :instructors, primary_key: :id, id: false do |t| + t.string :id + t.string :name + end + end +end diff --git a/db/migrate/20180223033800_create_rooms.rb b/db/migrate/20180223033800_create_rooms.rb new file mode 100644 index 0000000..c164d39 --- /dev/null +++ b/db/migrate/20180223033800_create_rooms.rb @@ -0,0 +1,9 @@ +class CreateRooms < ActiveRecord::Migration[5.1] + def change + create_table :rooms, primary_key: :uuid, id: false do |t| + t.string :uuid + t.string :facility_code + t.string :room_code + end + end +end diff --git a/db/migrate/20180223033822_create_schedules.rb b/db/migrate/20180223033822_create_schedules.rb new file mode 100644 index 0000000..0637734 --- /dev/null +++ b/db/migrate/20180223033822_create_schedules.rb @@ -0,0 +1,16 @@ +class CreateSchedules < ActiveRecord::Migration[5.1] + def change + create_table :schedules, primary_key: :uuid, id: false do |t| + t.string :uuid + t.integer :start_time + t.integer :end_time + t.boolean :mon + t.boolean :tues + t.boolean :wed + t.boolean :thurs + t.boolean :fri + t.boolean :sat + t.boolean :sun + end + end +end diff --git a/db/migrate/20180223033951_create_sections.rb b/db/migrate/20180223033951_create_sections.rb new file mode 100644 index 0000000..0630883 --- /dev/null +++ b/db/migrate/20180223033951_create_sections.rb @@ -0,0 +1,11 @@ +class CreateSections < ActiveRecord::Migration[5.1] + def change + create_table :sections, primary_key: :uuid, id: false do |t| + t.string :uuid + t.string :course_offering_uuid + t.string :number + t.string :section_type + t.string :schedule_uuid + end + end +end diff --git a/db/migrate/20180223034017_create_teachings.rb b/db/migrate/20180223034017_create_teachings.rb new file mode 100644 index 0000000..772bc56 --- /dev/null +++ b/db/migrate/20180223034017_create_teachings.rb @@ -0,0 +1,8 @@ +class CreateTeachings < ActiveRecord::Migration[5.1] + def change + create_table :teachings do |t| + t.string :section_uuid + t.string :instructor_id + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..58737ac --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,101 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20180223034017) do + + create_table "course_offerings", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "uuid" + t.string "course_uuid" + t.integer "term_code" + t.string "name" + t.string "short_name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "courses", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "uuid" + t.string "subject_code" + t.integer "number" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "grade_distributions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "course_offering_uuid" + t.string "section_number" + t.integer "a_count" + t.integer "ab_count" + t.integer "b_count" + t.integer "bc_count" + t.integer "c_count" + t.integer "d_count" + t.integer "f_count" + t.integer "s_count" + t.integer "u_count" + t.integer "cr_count" + t.integer "n_count" + t.integer "p_count" + t.integer "i_count" + t.integer "nw_count" + t.integer "nr_count" + t.integer "other_count" + end + + create_table "instructors", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "id" + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "rooms", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "uuid" + t.string "facility_code" + t.string "room_code" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "schedules", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "uuid" + t.integer "start_time" + t.integer "end_time" + t.boolean "mon" + t.boolean "tues" + t.boolean "wed" + t.boolean "thurs" + t.boolean "fri" + t.boolean "sat" + t.boolean "sun" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "sections", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "uuid" + t.string "course_offering_uuid" + t.string "number" + t.string "section_type" + t.string "schedule_uuid" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "teachings", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| + t.string "section_uuid" + t.string "instructor_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..1beea2a --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake new file mode 100644 index 0000000..a8a6cc9 --- /dev/null +++ b/lib/tasks/import.rake @@ -0,0 +1,81 @@ +require 'csv' + +# Todo: This takes way too long, and there's only 3 terms so far :| + +namespace :import do + desc "import courses" + task courses: :environment do + puts "importing courses" + CSV.foreach('courses.csv', :headers => true) do |row| + Course.create!(row.to_hash) + end + end + + desc "import offerings" + task course_offerings: :environment do + puts "importing course offerings" + CSV.foreach('course_offerings.csv', :headers => true) do |row| + CourseOffering.create!(row.to_hash) + end + end + + desc "import grades" + task grade_distributions: :environment do + puts "importing grades" + CSV.foreach('grade_distributions.csv', :headers => true) do |row| + GradeDistribution.create!(row.to_hash) + end + end + + desc "import instructors" + task instructors: :environment do + puts "importing instructors" + CSV.foreach('instructors.csv', :headers => true) do |row| + Instructor.create!(row.to_hash) + end + end + + desc "import rooms" + task rooms: :environment do + puts "importing rooms" + CSV.foreach('rooms.csv', :headers => true) do |row| + Room.create!(row.to_hash) + end + end + + desc "import schedules" + task schedules: :environment do + puts "importing schedules" + CSV.foreach('schedules.csv', :headers => true) do |row| + Schedule.create!(row.to_hash) + end + end + + desc "import sections" + task sections: :environment do + puts "importing sections" + CSV.foreach('sections.csv', :headers => true) do |row| + Section.create!(row.to_hash) + end + end + + desc "import teachings" + task teachings: :environment do + puts "importing teachings" + CSV.foreach('teachings.csv', :headers => true) do |row| + Teaching.create!(row.to_hash) + end + end +end + +desc "import all" +task :import do + Rake::Task['import:courses'].invoke + Rake::Task['import:course_offerings'].invoke + Rake::Task['import:grade_distributions'].invoke + Rake::Task['import:instructors'].invoke + Rake::Task['import:rooms'].invoke + Rake::Task['import:schedules'].invoke + Rake::Task['import:sections'].invoke + Rake::Task['import:teachings'].invoke +end diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..591c396 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "name": "madgrades_com", + "private": true, + "dependencies": {} +} diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..37b576a --- /dev/null +++ b/public/robots.txt @@ -0,0 +1 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..d19212a --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/controllers/course_offerings_controller_test.rb b/test/controllers/course_offerings_controller_test.rb new file mode 100644 index 0000000..db095da --- /dev/null +++ b/test/controllers/course_offerings_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class CourseOfferingsControllerTest < ActionDispatch::IntegrationTest + setup do + @course_offering = course_offerings(:one) + end + + test "should get index" do + get course_offerings_url + assert_response :success + end + + test "should get new" do + get new_course_offering_url + assert_response :success + end + + test "should create course_offering" do + assert_difference('CourseOffering.count') do + post course_offerings_url, params: { course_offering: { course_uuid: @course_offering.course_uuid, name: @course_offering.name, short_name: @course_offering.short_name, term_code: @course_offering.term_code, uuid: @course_offering.uuid } } + end + + assert_redirected_to course_offering_url(CourseOffering.last) + end + + test "should show course_offering" do + get course_offering_url(@course_offering) + assert_response :success + end + + test "should get edit" do + get edit_course_offering_url(@course_offering) + assert_response :success + end + + test "should update course_offering" do + patch course_offering_url(@course_offering), params: { course_offering: { course_uuid: @course_offering.course_uuid, name: @course_offering.name, short_name: @course_offering.short_name, term_code: @course_offering.term_code, uuid: @course_offering.uuid } } + assert_redirected_to course_offering_url(@course_offering) + end + + test "should destroy course_offering" do + assert_difference('CourseOffering.count', -1) do + delete course_offering_url(@course_offering) + end + + assert_redirected_to course_offerings_url + end +end diff --git a/test/controllers/courses_controller_test.rb b/test/controllers/courses_controller_test.rb new file mode 100644 index 0000000..23cff19 --- /dev/null +++ b/test/controllers/courses_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class CoursesControllerTest < ActionDispatch::IntegrationTest + setup do + @course = courses(:one) + end + + test "should get index" do + get courses_url + assert_response :success + end + + test "should get new" do + get new_course_url + assert_response :success + end + + test "should create course" do + assert_difference('Course.count') do + post courses_url, params: { course: { number: @course.number, subject_code: @course.subject_code, uuid: @course.uuid } } + end + + assert_redirected_to course_url(Course.last) + end + + test "should show course" do + get course_url(@course) + assert_response :success + end + + test "should get edit" do + get edit_course_url(@course) + assert_response :success + end + + test "should update course" do + patch course_url(@course), params: { course: { number: @course.number, subject_code: @course.subject_code, uuid: @course.uuid } } + assert_redirected_to course_url(@course) + end + + test "should destroy course" do + assert_difference('Course.count', -1) do + delete course_url(@course) + end + + assert_redirected_to courses_url + end +end diff --git a/test/controllers/grade_distributions_controller_test.rb b/test/controllers/grade_distributions_controller_test.rb new file mode 100644 index 0000000..75f527b --- /dev/null +++ b/test/controllers/grade_distributions_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class GradeDistributionsControllerTest < ActionDispatch::IntegrationTest + setup do + @grade_distribution = grade_distributions(:one) + end + + test "should get index" do + get grade_distributions_url + assert_response :success + end + + test "should get new" do + get new_grade_distribution_url + assert_response :success + end + + test "should create grade_distribution" do + assert_difference('GradeDistribution.count') do + post grade_distributions_url, params: { grade_distribution: { a_count: @grade_distribution.a_count, ab_count: @grade_distribution.ab_count, b_count: @grade_distribution.b_count, bc_count: @grade_distribution.bc_count, c_count: @grade_distribution.c_count, course_uuid: @grade_distribution.course_uuid, cr_count: @grade_distribution.cr_count, d_count: @grade_distribution.d_count, f_count: @grade_distribution.f_count, i_count: @grade_distribution.i_count, n_count: @grade_distribution.n_count, nr_count: @grade_distribution.nr_count, nw_count: @grade_distribution.nw_count, other_count: @grade_distribution.other_count, p_count: @grade_distribution.p_count, s_count: @grade_distribution.s_count, section_number: @grade_distribution.section_number, u_count: @grade_distribution.u_count } } + end + + assert_redirected_to grade_distribution_url(GradeDistribution.last) + end + + test "should show grade_distribution" do + get grade_distribution_url(@grade_distribution) + assert_response :success + end + + test "should get edit" do + get edit_grade_distribution_url(@grade_distribution) + assert_response :success + end + + test "should update grade_distribution" do + patch grade_distribution_url(@grade_distribution), params: { grade_distribution: { a_count: @grade_distribution.a_count, ab_count: @grade_distribution.ab_count, b_count: @grade_distribution.b_count, bc_count: @grade_distribution.bc_count, c_count: @grade_distribution.c_count, course_uuid: @grade_distribution.course_uuid, cr_count: @grade_distribution.cr_count, d_count: @grade_distribution.d_count, f_count: @grade_distribution.f_count, i_count: @grade_distribution.i_count, n_count: @grade_distribution.n_count, nr_count: @grade_distribution.nr_count, nw_count: @grade_distribution.nw_count, other_count: @grade_distribution.other_count, p_count: @grade_distribution.p_count, s_count: @grade_distribution.s_count, section_number: @grade_distribution.section_number, u_count: @grade_distribution.u_count } } + assert_redirected_to grade_distribution_url(@grade_distribution) + end + + test "should destroy grade_distribution" do + assert_difference('GradeDistribution.count', -1) do + delete grade_distribution_url(@grade_distribution) + end + + assert_redirected_to grade_distributions_url + end +end diff --git a/test/controllers/instructors_controller_test.rb b/test/controllers/instructors_controller_test.rb new file mode 100644 index 0000000..2aaf37d --- /dev/null +++ b/test/controllers/instructors_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class InstructorsControllerTest < ActionDispatch::IntegrationTest + setup do + @instructor = instructors(:one) + end + + test "should get index" do + get instructors_url + assert_response :success + end + + test "should get new" do + get new_instructor_url + assert_response :success + end + + test "should create instructor" do + assert_difference('Instructor.count') do + post instructors_url, params: { instructor: { id: @instructor.id, name: @instructor.name } } + end + + assert_redirected_to instructor_url(Instructor.last) + end + + test "should show instructor" do + get instructor_url(@instructor) + assert_response :success + end + + test "should get edit" do + get edit_instructor_url(@instructor) + assert_response :success + end + + test "should update instructor" do + patch instructor_url(@instructor), params: { instructor: { id: @instructor.id, name: @instructor.name } } + assert_redirected_to instructor_url(@instructor) + end + + test "should destroy instructor" do + assert_difference('Instructor.count', -1) do + delete instructor_url(@instructor) + end + + assert_redirected_to instructors_url + end +end diff --git a/test/controllers/rooms_controller_test.rb b/test/controllers/rooms_controller_test.rb new file mode 100644 index 0000000..65e0022 --- /dev/null +++ b/test/controllers/rooms_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class RoomsControllerTest < ActionDispatch::IntegrationTest + setup do + @room = rooms(:one) + end + + test "should get index" do + get rooms_url + assert_response :success + end + + test "should get new" do + get new_room_url + assert_response :success + end + + test "should create room" do + assert_difference('Room.count') do + post rooms_url, params: { room: { facility_code: @room.facility_code, room_code: @room.room_code, uuid: @room.uuid } } + end + + assert_redirected_to room_url(Room.last) + end + + test "should show room" do + get room_url(@room) + assert_response :success + end + + test "should get edit" do + get edit_room_url(@room) + assert_response :success + end + + test "should update room" do + patch room_url(@room), params: { room: { facility_code: @room.facility_code, room_code: @room.room_code, uuid: @room.uuid } } + assert_redirected_to room_url(@room) + end + + test "should destroy room" do + assert_difference('Room.count', -1) do + delete room_url(@room) + end + + assert_redirected_to rooms_url + end +end diff --git a/test/controllers/schedules_controller_test.rb b/test/controllers/schedules_controller_test.rb new file mode 100644 index 0000000..19ac5cf --- /dev/null +++ b/test/controllers/schedules_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class SchedulesControllerTest < ActionDispatch::IntegrationTest + setup do + @schedule = schedules(:one) + end + + test "should get index" do + get schedules_url + assert_response :success + end + + test "should get new" do + get new_schedule_url + assert_response :success + end + + test "should create schedule" do + assert_difference('Schedule.count') do + post schedules_url, params: { schedule: { end_time: @schedule.end_time, fri: @schedule.fri, mon: @schedule.mon, sat: @schedule.sat, start_time: @schedule.start_time, sun: @schedule.sun, thurs: @schedule.thurs, tues: @schedule.tues, wed: @schedule.wed } } + end + + assert_redirected_to schedule_url(Schedule.last) + end + + test "should show schedule" do + get schedule_url(@schedule) + assert_response :success + end + + test "should get edit" do + get edit_schedule_url(@schedule) + assert_response :success + end + + test "should update schedule" do + patch schedule_url(@schedule), params: { schedule: { end_time: @schedule.end_time, fri: @schedule.fri, mon: @schedule.mon, sat: @schedule.sat, start_time: @schedule.start_time, sun: @schedule.sun, thurs: @schedule.thurs, tues: @schedule.tues, wed: @schedule.wed } } + assert_redirected_to schedule_url(@schedule) + end + + test "should destroy schedule" do + assert_difference('Schedule.count', -1) do + delete schedule_url(@schedule) + end + + assert_redirected_to schedules_url + end +end diff --git a/test/controllers/sections_controller_test.rb b/test/controllers/sections_controller_test.rb new file mode 100644 index 0000000..10a23a5 --- /dev/null +++ b/test/controllers/sections_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class SectionsControllerTest < ActionDispatch::IntegrationTest + setup do + @section = sections(:one) + end + + test "should get index" do + get sections_url + assert_response :success + end + + test "should get new" do + get new_section_url + assert_response :success + end + + test "should create section" do + assert_difference('Section.count') do + post sections_url, params: { section: { course_offering_uuid: @section.course_offering_uuid, number: @section.number, schedule_uuid: @section.schedule_uuid, section_type: @section.section_type, uuid: @section.uuid } } + end + + assert_redirected_to section_url(Section.last) + end + + test "should show section" do + get section_url(@section) + assert_response :success + end + + test "should get edit" do + get edit_section_url(@section) + assert_response :success + end + + test "should update section" do + patch section_url(@section), params: { section: { course_offering_uuid: @section.course_offering_uuid, number: @section.number, schedule_uuid: @section.schedule_uuid, section_type: @section.section_type, uuid: @section.uuid } } + assert_redirected_to section_url(@section) + end + + test "should destroy section" do + assert_difference('Section.count', -1) do + delete section_url(@section) + end + + assert_redirected_to sections_url + end +end diff --git a/test/controllers/teachings_controller_test.rb b/test/controllers/teachings_controller_test.rb new file mode 100644 index 0000000..8f70d1e --- /dev/null +++ b/test/controllers/teachings_controller_test.rb @@ -0,0 +1,48 @@ +require 'test_helper' + +class TeachingsControllerTest < ActionDispatch::IntegrationTest + setup do + @teaching = teachings(:one) + end + + test "should get index" do + get teachings_url + assert_response :success + end + + test "should get new" do + get new_teaching_url + assert_response :success + end + + test "should create teaching" do + assert_difference('Teaching.count') do + post teachings_url, params: { teaching: { instructor_id: @teaching.instructor_id, section_uuid: @teaching.section_uuid } } + end + + assert_redirected_to teaching_url(Teaching.last) + end + + test "should show teaching" do + get teaching_url(@teaching) + assert_response :success + end + + test "should get edit" do + get edit_teaching_url(@teaching) + assert_response :success + end + + test "should update teaching" do + patch teaching_url(@teaching), params: { teaching: { instructor_id: @teaching.instructor_id, section_uuid: @teaching.section_uuid } } + assert_redirected_to teaching_url(@teaching) + end + + test "should destroy teaching" do + assert_difference('Teaching.count', -1) do + delete teaching_url(@teaching) + end + + assert_redirected_to teachings_url + end +end diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/course_offerings.yml b/test/fixtures/course_offerings.yml new file mode 100644 index 0000000..411555b --- /dev/null +++ b/test/fixtures/course_offerings.yml @@ -0,0 +1,15 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + uuid: MyString + course_uuid: MyString + term_code: 1 + name: MyString + short_name: MyString + +two: + uuid: MyString + course_uuid: MyString + term_code: 1 + name: MyString + short_name: MyString diff --git a/test/fixtures/courses.yml b/test/fixtures/courses.yml new file mode 100644 index 0000000..89abba0 --- /dev/null +++ b/test/fixtures/courses.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + uuid: MyString + subject_code: MyString + number: + +two: + uuid: MyString + subject_code: MyString + number: diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/grade_distributions.yml b/test/fixtures/grade_distributions.yml new file mode 100644 index 0000000..fe2ec0e --- /dev/null +++ b/test/fixtures/grade_distributions.yml @@ -0,0 +1,41 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + course_uuid: MyString + section_number: MyString + a_count: MyString + ab_count: MyString + b_count: MyString + bc_count: MyString + c_count: MyString + d_count: MyString + f_count: MyString + s_count: MyString + u_count: MyString + cr_count: MyString + n_count: MyString + p_count: MyString + i_count: MyString + nw_count: MyString + nr_count: MyString + other_count: MyString + +two: + course_uuid: MyString + section_number: MyString + a_count: MyString + ab_count: MyString + b_count: MyString + bc_count: MyString + c_count: MyString + d_count: MyString + f_count: MyString + s_count: MyString + u_count: MyString + cr_count: MyString + n_count: MyString + p_count: MyString + i_count: MyString + nw_count: MyString + nr_count: MyString + other_count: MyString diff --git a/test/fixtures/instructors.yml b/test/fixtures/instructors.yml new file mode 100644 index 0000000..6901b2d --- /dev/null +++ b/test/fixtures/instructors.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + id: MyString + name: MyString + +two: + id: MyString + name: MyString diff --git a/test/fixtures/rooms.yml b/test/fixtures/rooms.yml new file mode 100644 index 0000000..b6bc192 --- /dev/null +++ b/test/fixtures/rooms.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + uuid: MyString + facility_code: MyString + room_code: MyString + +two: + uuid: MyString + facility_code: MyString + room_code: MyString diff --git a/test/fixtures/schedules.yml b/test/fixtures/schedules.yml new file mode 100644 index 0000000..95ac8cd --- /dev/null +++ b/test/fixtures/schedules.yml @@ -0,0 +1,23 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + start_time: 1 + end_time: 1 + mon: MyString + tues: MyString + wed: MyString + thurs: MyString + fri: MyString + sat: MyString + sun: MyString + +two: + start_time: 1 + end_time: 1 + mon: MyString + tues: MyString + wed: MyString + thurs: MyString + fri: MyString + sat: MyString + sun: MyString diff --git a/test/fixtures/sections.yml b/test/fixtures/sections.yml new file mode 100644 index 0000000..5af6c74 --- /dev/null +++ b/test/fixtures/sections.yml @@ -0,0 +1,15 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + uuid: MyString + course_offering_uuid: MyString + number: MyString + section_type: MyString + schedule_uuid: MyString + +two: + uuid: MyString + course_offering_uuid: MyString + number: MyString + section_type: MyString + schedule_uuid: MyString diff --git a/test/fixtures/teachings.yml b/test/fixtures/teachings.yml new file mode 100644 index 0000000..73dc76b --- /dev/null +++ b/test/fixtures/teachings.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + section_uuid: MyString + instructor_id: MyString + +two: + section_uuid: MyString + instructor_id: MyString diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/course_offering_test.rb b/test/models/course_offering_test.rb new file mode 100644 index 0000000..4d1c644 --- /dev/null +++ b/test/models/course_offering_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CourseOfferingTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/course_test.rb b/test/models/course_test.rb new file mode 100644 index 0000000..4afb5cd --- /dev/null +++ b/test/models/course_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CourseTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/grade_distribution_test.rb b/test/models/grade_distribution_test.rb new file mode 100644 index 0000000..90079ae --- /dev/null +++ b/test/models/grade_distribution_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class GradeDistributionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/instructor_test.rb b/test/models/instructor_test.rb new file mode 100644 index 0000000..4c504ee --- /dev/null +++ b/test/models/instructor_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class InstructorTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/room_test.rb b/test/models/room_test.rb new file mode 100644 index 0000000..2f0b89f --- /dev/null +++ b/test/models/room_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RoomTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/schedule_test.rb b/test/models/schedule_test.rb new file mode 100644 index 0000000..8e3ee1d --- /dev/null +++ b/test/models/schedule_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ScheduleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/section_test.rb b/test/models/section_test.rb new file mode 100644 index 0000000..b8b5039 --- /dev/null +++ b/test/models/section_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SectionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/teaching_test.rb b/test/models/teaching_test.rb new file mode 100644 index 0000000..5c0bae2 --- /dev/null +++ b/test/models/teaching_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TeachingTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/system/course_offerings_test.rb b/test/system/course_offerings_test.rb new file mode 100644 index 0000000..bc23b80 --- /dev/null +++ b/test/system/course_offerings_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class CourseOfferingsTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit course_offerings_url + # + # assert_selector "h1", text: "CourseOffering" + # end +end diff --git a/test/system/courses_test.rb b/test/system/courses_test.rb new file mode 100644 index 0000000..51d008f --- /dev/null +++ b/test/system/courses_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class CoursesTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit courses_url + # + # assert_selector "h1", text: "Course" + # end +end diff --git a/test/system/grade_distributions_test.rb b/test/system/grade_distributions_test.rb new file mode 100644 index 0000000..aa2b01b --- /dev/null +++ b/test/system/grade_distributions_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class GradeDistributionsTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit grade_distributions_url + # + # assert_selector "h1", text: "GradeDistribution" + # end +end diff --git a/test/system/instructors_test.rb b/test/system/instructors_test.rb new file mode 100644 index 0000000..0ec11d7 --- /dev/null +++ b/test/system/instructors_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class InstructorsTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit instructors_url + # + # assert_selector "h1", text: "Instructor" + # end +end diff --git a/test/system/rooms_test.rb b/test/system/rooms_test.rb new file mode 100644 index 0000000..16cc535 --- /dev/null +++ b/test/system/rooms_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class RoomsTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit rooms_url + # + # assert_selector "h1", text: "Room" + # end +end diff --git a/test/system/schedules_test.rb b/test/system/schedules_test.rb new file mode 100644 index 0000000..3935349 --- /dev/null +++ b/test/system/schedules_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class SchedulesTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit schedules_url + # + # assert_selector "h1", text: "Schedule" + # end +end diff --git a/test/system/sections_test.rb b/test/system/sections_test.rb new file mode 100644 index 0000000..6b06aa2 --- /dev/null +++ b/test/system/sections_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class SectionsTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit sections_url + # + # assert_selector "h1", text: "Section" + # end +end diff --git a/test/system/teachings_test.rb b/test/system/teachings_test.rb new file mode 100644 index 0000000..66eeb02 --- /dev/null +++ b/test/system/teachings_test.rb @@ -0,0 +1,9 @@ +require "application_system_test_case" + +class TeachingsTest < ApplicationSystemTestCase + # test "visiting the index" do + # visit teachings_url + # + # assert_selector "h1", text: "Teaching" + # end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..e3c4ff0 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,9 @@ +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29