rubycas/rubycas-server — pull request #219 by davexunit (2014-07-21 18:55:37+00:00)
Title: Allow multiple SQL authenticators to be used without conflict.

Rather than clobber the `user_model` class variable every time a SQL authenticator is used, use a hash to map `auth_index` to the associated user model. This allows for using a configuration that authenticates with multiple SQL databases. Without this patch, the server will only query against the last database specified in the authenicator array in your config.yml.

There are no unit tests at all for the SQL authenticators so I did not include tests, but I could try to add some if required.

Thoughts?

As as aside, is it important that the generated classes have a name? The code can further cleaned up by removing the calls to `class_eval` and `const_get` and instead use `Class.new(ActiveRecord::Base)` to create the user model class.