Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Makes mongoid and active_model_serializers play nicely together
# config/initializers/active_model_serializers.rb
Mongoid::Document.send(:include, ActiveModel::SerializerSupport)
Mongoid::Criteria.delegate(:active_model_serializer, :to => :to_a)
@quartzmo

This comment has been minimized.

Copy link

@quartzmo quartzmo commented Apr 11, 2012

Thanks this was helpful!

@boy-jer

This comment has been minimized.

Copy link

@boy-jer boy-jer commented May 16, 2012

many thanks!

@ianpetzer

This comment has been minimized.

Copy link

@ianpetzer ianpetzer commented Feb 14, 2013

Awesome.. thanks!

@guiltry

This comment has been minimized.

Copy link

@guiltry guiltry commented May 20, 2014

I wasted a lot of time just for this.
Thank you.

@xuanyu-h

This comment has been minimized.

Copy link

@xuanyu-h xuanyu-h commented Oct 18, 2014

Thank you!

@corehook

This comment has been minimized.

Copy link

@corehook corehook commented Apr 2, 2016

GJ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment