Browse Source

Optimisations

remotes/origin/master
echarp 2 years ago
parent
commit
81f2e3add7
  1. 4
      app/models/event.rb
  2. 3
      app/views/orgas/index.html.haml

4
app/models/event.rb

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

3
app/views/orgas/index.html.haml

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

Loading…
Cancel
Save