Skip to content

Commit

Permalink
Merge pull request #1144 from PlanoramaEvents/staging
Browse files Browse the repository at this point in the history
3.7.3
  • Loading branch information
balen authored Jul 26, 2024
2 parents 8acf2d0 + c6243f5 commit f6966b4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 24 deletions.
3 changes: 2 additions & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ def join_tables
conflict_counts,
sessions.create_on(
conflict_counts[:session_id].eq(sessions[:id])
)
),
Arel::Nodes::OuterJoin
),
sessions.create_join(
published_sessions,
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/stylesheets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dt {

#mobile-navbar {
&.not-production {
// background-color: #ec6fde !important;
background-color: #ec6fde !important;
}
border-bottom: 2px solid $color-primary-4;
}
Expand Down
30 changes: 9 additions & 21 deletions app/models/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,32 +218,20 @@ def keep_interest_trail
end

def self.conflict_counts
sessions = Session.arel_table
conflicts = Conflicts::SessionConflict.arel_table
ignored_conflicts = ::IgnoredConflict.arel_table

sessions.project(
sessions[:id].as('session_id'),
conflicts.project(
conflicts[:session_id].as('session_id'),
conflicts[:session_id].count.as('conflict_count')
)
.join(conflicts, Arel::Nodes::OuterJoin)
.on(
sessions[:id].eq(conflicts[:session_id])
.or(
sessions[:id].eq(conflicts[:conflict_session_id])
.and(
conflicts[:conflict_type].not_eq('room_conflict')
.or(
conflicts[:conflict_type].eq('room_conflict')
.and(
conflicts[:session_start_time].not_eq(conflicts[:conflict_session_start_time])
)
.where(
conflicts[:conflict_type].not_eq('room_conflict')
.or(
conflicts[:conflict_type].eq('room_conflict')
.and(
conflicts[:session_start_time].not_eq(conflicts[:conflict_session_start_time])
)
# .and(
# conflicts[:conflict_type].not_eq('person_schedule_conflict')
# .and(conflicts[:conflict_type].not_eq('person_back_to_back'))
# )
)
)
.and(
conflicts[:session_assignment_name].eq(nil).or(conflicts[:session_assignment_name].in(['Moderator', 'Participant', 'Invisible'])).and(
Expand All @@ -255,7 +243,7 @@ def self.conflict_counts
)
)
)
.group('sessions.id')
.group('session_conflicts.session_id')
end

def schedule_consistency
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/session_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class SessionSerializer

attribute :has_conflicts do |session|
if session.has_attribute?(:conflict_count)
session.conflict_count > 0
session.conflict_count && session.conflict_count > 0
else
(session.session_conflicts.count > 0) || (session.conflict_sessions.count > 0)
end
Expand Down

0 comments on commit f6966b4

Please sign in to comment.