Commit ede77540 authored by Zach Perkins's avatar Zach Perkins
Browse files

Rubocop, my old foe

parent 9f011a08
Pipeline #3221 passed with stage
in 2 minutes and 12 seconds
...@@ -25,11 +25,11 @@ class SchedulesController < ApplicationController ...@@ -25,11 +25,11 @@ class SchedulesController < ApplicationController
"S": Date.new(2019, 1, 19), "S": Date.new(2019, 1, 19),
"U": Date.new(2019, 1, 20) "U": Date.new(2019, 1, 20)
}.freeze }.freeze
def show def show
@events = @cart.map do |_cid, sections| @events = @cart.map do |_cid, sections|
s = sections.first s = sections.first
s.days.split('').map do |day| s.days.split('').map do |day|
formatted_date = DAYS[day.to_sym].to_s.tr('-', '') formatted_date = DAYS[day.to_sym].to_s.tr('-', '')
time = Time.parse(s.start_time).strftime("%H%M%S") time = Time.parse(s.start_time).strftime("%H%M%S")
...@@ -41,7 +41,6 @@ class SchedulesController < ApplicationController ...@@ -41,7 +41,6 @@ class SchedulesController < ApplicationController
end: "#{formatted_date}T#{endtime}" end: "#{formatted_date}T#{endtime}"
} }
end end
end.flatten end.flatten
end end
end end
...@@ -13,9 +13,9 @@ class CourseSection < ApplicationRecord ...@@ -13,9 +13,9 @@ class CourseSection < ApplicationRecord
def labs def labs
return nil unless section_type == "Lecture" return nil unless section_type == "Lecture"
lecture_number = name.split[name.split.length-1] lecture_number = name.split[name.split.length - 1]
course.course_sections.select do |s| course.course_sections.select do |s|
s.title.split[s.title.split.length-1] == lecture_number s.title.split[s.title.split.length - 1] == lecture_number
end end
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