diff --git a/app/views/public/menu_items/index.html.haml b/app/views/public/menu_items/index.html.haml index 70d5bc3..0a55d4a 100644 --- a/app/views/public/menu_items/index.html.haml +++ b/app/views/public/menu_items/index.html.haml @@ -41,7 +41,7 @@ .col-xs-12.col-md-6.col-lg-3 %span.chiffre -r = 0 - -MEvent.where("start_at >= ? and start_at <= ? ", Date.today.beginning_of_year.beginning_of_year, Date.today.beginning_of_year.end_of_year).all.each do |m_event| + -MEvent.joins(:organisateur).where(:organisateurs => {:public => true}).where("start_at >= ? and start_at <= ? ", Date.today.beginning_of_year.beginning_of_year, Date.today.beginning_of_year.end_of_year).all.each do |m_event| -r+=(m_event.end_at - m_event.start_at ).to_i / (24 * 60 * 60) +1 =r %span.label-chiffre Dates