Sutto / rocket_pants

API building tools on top of ActionController. Also, an awesome name.
MIT License
981 stars 130 forks source link

rocket_pants hanging #76

Closed ajbraus closed 11 years ago

ajbraus commented 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

caches :index, :show, :caches_for => 5.minutes

def index expose Event.all end end

ajbraus commented 11 years ago

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