1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

optimize export subscriptions & reservations queries

This commit is contained in:
Sylvain 2016-07-12 13:16:24 +02:00
parent 827b3334e1
commit 1b17290395

View File

@ -91,7 +91,7 @@ class API::MembersController < API::ApiController
# export subscriptions
def export_subscriptions
authorize :export
@subscriptions = Subscription.includes(:plan, :user).all
@subscriptions = Subscription.all.includes(:plan, :user => [:profile])
render xlsx: 'export_subscriptions.xlsx', filename: "export_subscriptions.xlsx"
end
@ -99,7 +99,7 @@ class API::MembersController < API::ApiController
# export reservations
def export_reservations
authorize :export
@reservations = Reservation.includes(:user, :slots).all
@reservations = Reservation.all.includes(:slots, :user => [:profile])
render xlsx: 'export_reservations.xlsx', filename: "export_reservations.xlsx"
end