stffn/declarative_authorization — pull request #151 by jhawthorn (2012-08-05 17:24:03+00:00)
Title: under ruby 1.9.2, .name returns nil for anonymous classes

Inside Authorization::Usage::Disables.usages_by_controller is the line

controllers << obj if obj.ancestors.include?(ActionController::Base) and obj != ActionController::Base and obj.name.demodulize != 'ApplicationController'

Under 1.9.2 and above this raises an exception when there it encounters an anonymous class, where .name returns nil (1.8.7 returns '').

This fix makes all rails 3 tests pass on 1.9.2 and 1.9.3.