Commit 758c4ec2 authored by Zac Wood's avatar Zac Wood

fixed crash with online courses

parent b47e5386
Pipeline #3507 failed with stage
in 2 minutes and 15 seconds
v2.1.0
- Added "Save as PNG" feature for the calendar view
- Fixed bugs related to exporting/sharing a view-only schedule
v2.1.1
- Fixed crash related to adding online courses
......@@ -10,6 +10,6 @@ ENV RAILS_ENV production
RUN bundle install
RUN export SECRET_KEY_BASE=$(rails secret)
RUN rake assets:precompile
RUN rails assets:precompile
RUN rails db:migrate
RUN rails db:seed
FROM ruby:2.5
# Copy the project files to /api
COPY . /api
# Tell Docker to run all commands in /api
WORKDIR /api
# Install project dependencies
RUN bundle install
# Perform database migrations
RUN rails db:migrate
# Load the database from Patriot Web
RUN rails db:seed
......@@ -5,19 +5,26 @@ class SchedulesController < ApplicationController
def show
valid_crns = @cart.reject { |crn|
s = CourseSection.find_by_crn(crn)
s.nil? || s.start_time == "TBA" || s.end_time == "TBA"
s.nil?
}
@all = valid_crns.map { |crn|
CourseSection.latest_by_crn(crn)
}
@events = generate_fullcalender_events(@all)
@without_online = @all.reject { |s|
s.start_time == "TBA" || s.end_time == "TBA"
}
@events = generate_fullcalender_events(@without_online)
end
def view
@all = params[:crns].split(',').map { |crn|
CourseSection.latest_by_crn(crn)
}
@events = generate_fullcalender_events(@all)
@all.reject! { |s| s.nil? }
@without_online = @all.reject { |s|
s.start_time == "TBA" || s.end_time == "TBA"
}
@events = generate_fullcalender_events(@without_online)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment