Optimisations

This commit is contained in:
echarp 2020-02-08 15:44:11 +01:00
parent 758cb7cb79
commit 81f2e3add7
2 changed files with 3 additions and 4 deletions

View File

@ -43,9 +43,7 @@ class Event < ApplicationRecord
after_destroy EventCallbacks after_destroy EventCallbacks
# The 3000 limit is purely arbitrary... # The 3000 limit is purely arbitrary...
default_scope do default_scope { includes(:base_tags).order('events.id desc').limit(3000) }
includes(:base_tags).order('events.id desc').limit(3000)
end
scope :moderated, ->(*) { where moderated: true } scope :moderated, ->(*) { where moderated: true }
scope :unmoderated, ->(*) { where moderated: false } scope :unmoderated, ->(*) { where moderated: false }
scope :past, -> { where 'start_time <= ?', Time.zone.now } scope :past, -> { where 'start_time <= ?', Time.zone.now }

View File

@ -1,4 +1,5 @@
= render '/maps/orgas' - unless params[:iframe]
= render '/maps/orgas'
%h2 %h2
%em.fa.fa-users %em.fa.fa-users