DavyJonesLocker / postgres_ext-serializers

MIT License
324 stars 30 forks source link

I added require 'postgres_ext/serializers' to my active_model_serializers init file, but I don't see it pulling the JSON from postgres #36

Closed ballertv closed 8 years ago

ballertv commented 9 years ago

Hi, this seems so simple to setup, but I can't seem to get any basic functionality to work in terms of moving the JSON from rails to postgres. I tried including the following in my ams init, in my specific serializers and in my models, but it never seems to be activating.

I'm on Rails 4.2.3

and this is what I've tried adding to multiple files:

require 'postgres_ext/serializers'

Really appreciate your help, I know I must be missing something obvious. Love the concept of this gem btw... we were going to hand roll all our serializers in SQL postgres, which would be very tedious and this gem will save us a lot of pain if we can get it to work.

Thanks!

ballertv commented 9 years ago

Figured it out. Turns out I was testing this gem using User.first(10) which doesn't return an ActiveRecord:Relation

felixbuenemann commented 8 years ago

Yes, you could use User.limit(10) instead.