radar/by_star — pull request #14 by johnnyshields (2013-01-05 22:59:42+00:00)
Title: Added (almost) full support for Mongoid (adapter for MongoDB)

Added support for Mongoid (adapter for MongoDB). It's basically a monkey-patch file (see: lib/mongoid/by_star.rb) with a small change at the end of lib/by_star.rb to detect inclusion of ActiveRecord and/or Mongoid.

I refactored the specs so that the exact same specs can be run by both Mongoid and ActiveRecord seamlessly (core specs now moved to /spec/by_star/generic). I am able to pass 49/60 ActiveRecord specs (i.e. prior to this commit; I have not introduced any regressions) and 50/60 Mongoid test--basically the same ones fail, the only exception is "by year/should be able to order the result set" which I believe is genuinely broken on Mongoid due to API differences.

Updated readme as well.