Closed ajbraus closed 11 years ago
App hanging for minutes when I visit localhost:3000/4/events with folllowing setup:
event.rb class Event < ActiveRecord::Base include RocketPants::Cacheable
routes.rb api versions: 4, module: "api/v4" do resources :events
api_controller.rb class ApiController < RocketPants::Base end
controllers/api/v4/events_controller.rb class Api::V4::EventsController < ApiController version 4
def index expose Event.all end end
I figured this out. It is actually an active_model_serializer problem of creating an invitite loop through "has_many" associations.
https://github.com/rails-api/active_model_serializers/issues/211
App hanging for minutes when I visit localhost:3000/4/events with folllowing setup:
event.rb class Event < ActiveRecord::Base include RocketPants::Cacheable
routes.rb api versions: 4, module: "api/v4" do resources :events
api_controller.rb class ApiController < RocketPants::Base end
controllers/api/v4/events_controller.rb class Api::V4::EventsController < ApiController version 4
caches :index, :show, :caches_for => 5.minutes
def index expose Event.all end end