Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ActiveModel serializer with Mongoid
# config/initializers/mongoid_active_model_initializer.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