From 001688a15cae7b98c899a8eefa72763fc85123f0 Mon Sep 17 00:00:00 2001 From: nicolas-entourage <75681929+nicolas-entourage@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:25:55 +0100 Subject: [PATCH] optim: use @neighborhood.number_of_root_chat_messages --- app/models/neighborhood.rb | 4 ---- app/views/admin/neighborhoods/_edit_header.html.erb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/neighborhood.rb b/app/models/neighborhood.rb index fdf4f53b5..c0b45dcb9 100644 --- a/app/models/neighborhood.rb +++ b/app/models/neighborhood.rb @@ -220,10 +220,6 @@ def display_address= display_address self[:longitude] = google_place_details[:longitude] end - def posts_count - posts.length - end - def outings_with_admin_online scope: :outings scope = :outings unless [:past_outings, :future_outings, :ongoing_outings].include?(scope) diff --git a/app/views/admin/neighborhoods/_edit_header.html.erb b/app/views/admin/neighborhoods/_edit_header.html.erb index 9ea973b7b..ac445a0a4 100644 --- a/app/views/admin/neighborhoods/_edit_header.html.erb +++ b/app/views/admin/neighborhoods/_edit_header.html.erb @@ -23,7 +23,7 @@ <%= link_to "Événements (#{@neighborhood.outings.count})", show_outings_admin_neighborhood_path(@neighborhood) %> <% if tab == :show_outing_chat_messages || @outing.present? %>