diff --git a/app/controllers/flights_controller.rb b/app/controllers/flights_controller.rb index 4887e95..d999de5 100644 --- a/app/controllers/flights_controller.rb +++ b/app/controllers/flights_controller.rb @@ -22,7 +22,7 @@ class FlightsController < ApplicationController # |:-----|:----------------------| # | `id` | The UUID of a Flight. | - def show = respond_with @flight + def show = respond_with(@flight) if stale?(@flight) private diff --git a/app/controllers/pilot/flights_controller.rb b/app/controllers/pilot/flights_controller.rb index 63389de..dfcbb11 100644 --- a/app/controllers/pilot/flights_controller.rb +++ b/app/controllers/pilot/flights_controller.rb @@ -17,7 +17,7 @@ class Pilot::FlightsController < ApplicationController def index @flights = current_pilot.flights.with_passenger_count.order(date: :desc) - respond_with @flights + respond_with(@flights) if stale?(@flights) end # Creates a new Flight for a pilot from the given parameters.