diff --git a/FireResponse/app/controllers/tables_controller.rb b/FireResponse/app/controllers/tables_controller.rb index da01b27..54eadad 100644 --- a/FireResponse/app/controllers/tables_controller.rb +++ b/FireResponse/app/controllers/tables_controller.rb @@ -2,9 +2,11 @@ class TablesController < ApplicationController AirtableSheets.each do |k,v| define_method(k) do - ::Rails.cache.fetch("cache/#{k}", expires_in: 30.seconds) do - render json: v.all.to_json + records = ::Rails.cache.fetch("cache/#{k}", expires_in: 30.seconds) do + v.all.to_json end + + render json: records end end end