Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gnepud/3002310 to your computer and use it in GitHub Desktop.
Save gnepud/3002310 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