Skip to content

Instantly share code, notes, and snippets.

@benedikt
Created March 2, 2012 17:40
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save benedikt/1959907 to your computer and use it in GitHub Desktop.
Save benedikt/1959907 to your computer and use it in GitHub Desktop.
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)
@corehook
Copy link

corehook commented Apr 2, 2016

GJ!

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