mindscratch/mongoid-indifferent-access — pull request #1 by incorvia (2012-08-07 16:14:48+00:00)
Title: Ensure indifferent access for subclasses

This pull request adds indifferent access support to subclasses of a class that has included the mongoid-indifferent-access module.

When Mongoid defines 'field' it automatically defines it for all subclasses. Since mongoid-indifferent-access did not do this also, there was a situation where a call to load a superclass after a subclass has already been loaded breaks indifferent-access-support for its subclasses. This happens because the call to 'super' inside mongoid-indifferent-access will define the getters and setters for the current class and all subclasses but mongoid-indifferent-access doesn't redefine these subclasses, it only redefines those of 'self'. This extraneous case can arise when using Sidekiq with Mongoid as Sidekiq Workers will load rails, then call Rails.application.eager_load!

To ensure that testing for this works, I've removed the MockSuper and now use Mongoid::Document directly which will require MongoDB, but as this gme is called "mongoid"-indifferent-access, I think this is a tradeoff we can live with.

Also includes a version bump