scambra/devise_invitable — pull request #171 by lawso017 (2012-02-20 08:48:08+00:00)
Title: Fixing Mongo tests and reverting to prior instance invite! behavior

Don't know if you'd want to pull all of this back in, but:

1) I needed to revert back to the 0.5.0 functionality for the instance method invite!. There is contextual information available in having an instance that simply can't be replicated by trying to run everything through the class method interface and querying on the email. Our use case is further complicated by the fact that we have a one-to-one relationship between Person and User, with not every Person being a User -- so if you User.invite!(:existing_email, :different_person) via the class method, the new logic causes an existing user to be reassigned to a new (incorrect) person. The prior logic just worked, so we're going to roll with that.

2) I fixed the mongodb tests so that they work. All you should need to do is a brew install of mongodb, start it in a terminal window, and rake runs cleanly for both activerecord and mongo. Just needed a few tweaks to the configuration files, and the model attributes to be defined for mongo in the testing rails app.

Thanks...