Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
ede77540
Commit
ede77540
authored
Oct 11, 2018
by
Zach Perkins
Browse files
Rubocop, my old foe
parent
9f011a08
Pipeline
#3221
passed with stage
in 2 minutes and 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
schedules/app/controllers/schedules_controller.rb
View file @
ede77540
...
@@ -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
schedules/app/models/course_section.rb
View file @
ede77540
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment