GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
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. http://travis-ci.org/#!/jhawthorn/declarative_authorization/builds/2041629
under ruby 1.9.2, Class.new.name returns nil
Adjust Authorization::Usage::Disables.usages_by_controller to behave the
same as under 1.8.7 when provided an anonymous class rather than
attempting to call .demodularize on nil.
Merge pull request #151 from jhawthorn/class_nil_in_19
under ruby 1.9.2, .name returns nil for anonymous classes
Thanks for the fix!