Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boy-jer/2709577 to your computer and use it in GitHub Desktop.
Save boy-jer/2709577 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment