Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions app/models/communication/website/agenda/event/localization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class Communication::Website::Agenda::Event::Localization < ApplicationRecord
:time_zone,
:kind_simple?,
:kind_recurring?,
:kind_parent?,
:kind_child?,
to: :event

Expand Down Expand Up @@ -106,7 +105,7 @@ def should_sync_to?(website)
website.active_language_ids.include?(language_id) &&
published? &&
event.time_slots.none? && # Rendered by Communication::Website::Agenda::Event::TimeSlot
event.children.none? # Rendered by Communication::Website::Agenda::Event::Day
children.published.none? # Rendered by Communication::Website::Agenda::Event::Day
end

def template_static
Expand Down Expand Up @@ -136,10 +135,16 @@ def parent
event.parent&.localization_for(language)
end

# If there's no published children, it's a simple event
# https://github.com/osunyorg/gaitelyrique-www/issues/139
def kind_parent?
children.published.any?
end

def hugo(website)
if event.time_slots.any?
hugo_for_time_slots(website)
elsif event.kind_parent?
elsif kind_parent?
hugo_for_parent(website)
else
super(website)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def kind
end
end


def kind_simple?
children.none? && !multiple_time_slots?
end
Expand Down
Loading