Skip to content

Instantly share code, notes, and snippets.

@hypomodern
Created January 21, 2013 03:41
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 hypomodern/4583436 to your computer and use it in GitHub Desktop.
Save hypomodern/4583436 to your computer and use it in GitHub Desktop.
Want to use ActiveModel::Serializers with Mongoid-backed models? Here's the initializer you're looking for:
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