rubycas / rubycas-client

Ruby client for Yale's Central Authentication Service protocol -- an open source enterprise single sign on system for web applications.
http://code.google.com/p/rubycas-client/
Other
332 stars 217 forks source link

Explicitly test for ActionController::Base in addition to Rails #71

Closed Narnach closed 10 years ago

Narnach commented 11 years ago

We use rubycas-client in a Rack-based project where we use do ActiveRecord, but not ActionController. In combination with standalone-migrations (which does a require on Rails to get ActiveRecord + migrations code loaded), this creates the situation where:

rubycas-client does a check if Rails is defined, and if so it goes ahead and loads the Rails-specific extensions.

The problem here is that the rubycas-client Rails extensions are actually for ActionController, which is usually included when Rails exists, but not always (as in our situation).

I've included a patch which checks explicitly for ActionController::Base in addition to Rails, prior to attempting to load the Rails extensions.

Can the code be merged into master?