Removed limit which was interacting to the stats count

This commit is contained in:
echarp 2020-02-08 16:00:17 +01:00
parent 81f2e3add7
commit 19826f581a
3 changed files with 4 additions and 4 deletions

View File

@ -83,7 +83,8 @@ class EventsController < ApplicationController
private private
def set_events 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' @events = @events.limit(20) if params[:format] == 'rss'
end end

View File

@ -30,7 +30,7 @@ class StatsController < ApplicationController
def set_events def set_events
# Remove the ordering which can occur after geocoding # Remove the ordering which can occur after geocoding
@events = apply_scopes(Event.moderated).reorder nil @events = apply_scopes(Event.unscoped.moderated).reorder nil
end end
def year_grouping def year_grouping

View File

@ -42,8 +42,7 @@ class Event < ApplicationRecord
after_destroy EventCallbacks after_destroy EventCallbacks
# The 3000 limit is purely arbitrary... default_scope { includes(:base_tags).order('events.id desc') }
default_scope { includes(:base_tags).order('events.id desc').limit(3000) }
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 }