Skip to content
Extraits de code Groupes Projets
Valider 19826f58 rédigé par echarp's avatar echarp
Parcourir les fichiers

Removed limit which was interacting to the stats count

parent 81f2e3ad
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -83,7 +83,8 @@ class EventsController < ApplicationController
private
def set_events
@events = apply_scopes Event.moderated
# The 3000 limit is purely arbitrary...
@events = apply_scopes Event.moderated.limit(3000)
@events = @events.limit(20) if params[:format] == 'rss'
end
......
......@@ -30,7 +30,7 @@ class StatsController < ApplicationController
def set_events
# Remove the ordering which can occur after geocoding
@events = apply_scopes(Event.moderated).reorder nil
@events = apply_scopes(Event.unscoped.moderated).reorder nil
end
def year_grouping
......
......@@ -42,8 +42,7 @@ class Event < ApplicationRecord
after_destroy EventCallbacks
# The 3000 limit is purely arbitrary...
default_scope { includes(:base_tags).order('events.id desc').limit(3000) }
default_scope { includes(:base_tags).order('events.id desc') }
scope :moderated, ->(*) { where moderated: true }
scope :unmoderated, ->(*) { where moderated: false }
scope :past, -> { where 'start_time <= ?', Time.zone.now }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter