1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

cancelled event management on front page

Cancelled event (nb_total_places = -1) are not prompted anymore on the
homepage >> no need to push them to the final user.

They are still display in the event module for continuity
This commit is contained in:
siteswapjuggler 2017-09-24 18:17:40 +02:00
parent 37bdfcb96f
commit 3e2e5f5972

View File

@ -18,8 +18,10 @@ class API::EventsController < API::ApiController
def upcoming
limit = params[:limit]
@events = Event.includes(:event_image, :event_files, :availability, :category)
.where('events.nb_total_places != -1 OR events.nb_total_places IS NULL')
.where('availabilities.start_at >= ?', Time.now)
.order('availabilities.start_at ASC').references(:availabilities).limit(limit)
.order('availabilities.start_at ASC').references(:availabilities)
.limit(limit)
end
def show