Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rescheduled 🗓️
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
c3lingo
rescheduled 🗓️
Commits
12d915dd
Commit
12d915dd
authored
11 months ago
by
Teal
Browse files
Options
Downloads
Patches
Plain Diff
relevant stages changes
parent
9eb06684
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/conferences_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/conferences_controller.rb
app/jobs/telegram_notify_upcoming_job.rb
+1
-1
1 addition, 1 deletion
app/jobs/telegram_notify_upcoming_job.rb
app/models/session.rb
+7
-5
7 additions, 5 deletions
app/models/session.rb
with
9 additions
and
7 deletions
app/controllers/conferences_controller.rb
+
1
−
1
View file @
12d915dd
...
...
@@ -5,7 +5,7 @@ class ConferencesController < ApplicationController
def
show
@conference
=
Conference
.
find_by
(
slug:
params
[
:slug
])
@sessions
=
@conference
.
sessions
.
where
.
not
(
starts_at:
nil
).
includes
(
:stage
,
:assignments
).
where
(
stage:
{
name:
[
"Stage 1"
,
"Stage 2"
,
"Standby"
]
}
).
order
(
:starts_at
)
@sessions
=
@conference
.
sessions
.
where
.
not
(
starts_at:
nil
).
includes
(
:stage
,
:assignments
).
where
(
stage:
@conference
.
relevant_stages
).
order
(
:starts_at
)
if
params
[
:date
]
date
=
Time
.
parse
(
params
[
:date
])
logger
.
debug
(
date
)
...
...
This diff is collapsed.
Click to expand it.
app/jobs/telegram_notify_upcoming_job.rb
+
1
−
1
View file @
12d915dd
...
...
@@ -4,7 +4,7 @@ class TelegramNotifyUpcomingJob < ApplicationJob
def
perform
(
args
)
offset
=
args
[
"offset"
]
interval
=
args
[
"interval"
]
Session
.
scheduled
.
includes
(
:stage
,
:assignments
).
where
(
stage:
{
name:
[
"Stage 1"
,
"Stage 2"
,
"Standby"
]
}
).
where
(
starts_at:
(
Time
.
now
+
offset
)
..
(
Time
.
now
+
offset
+
interval
)).
order
(
:starts_at
).
each
do
|
session
|
Session
.
scheduled
.
includes
(
:stage
,
:assignments
).
where
(
stage:
RelevantStage
.
joins
(
:stage
).
map
(
&
:stage
)
).
where
(
starts_at:
(
Time
.
now
+
offset
)
..
(
Time
.
now
+
offset
+
interval
)).
order
(
:starts_at
).
each
do
|
session
|
puts
session
.
inspect
assignees
=
session
.
assignments
.
map
(
&
:user
)
if
assignees
.
length
.
positive?
...
...
This diff is collapsed.
Click to expand it.
app/models/session.rb
+
7
−
5
View file @
12d915dd
...
...
@@ -27,18 +27,20 @@ class Session < ApplicationRecord
super
.
in_time_zone
(
conference
.
time_zone
)
end
def
is_interpreted
# XXX
[
"Stage 1"
,
"Stage 2"
].
include?
stage
.
name
def
is_interpreted?
is_relevant?
end
def
is_relevant?
RelevantStage
.
exists?
(
stage
:)
end
def
translators_needed?
is_interpreted
&&
assignments
.
length
<
2
is_interpreted
?
&&
assignments
.
length
<
2
end
def
backup_needed?
return
false
# is_interpreted && assignments.length < 4
end
def
assignees?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment