Skip to content
This repository
Browse code

Merge pull request #3193 from avakhov/patch-ac-test-case-safe-constan…

…tize

use safe_constantize instead constantize in AC::TestCase
  • Loading branch information...
commit 9c6d4801d1a2ef026feb2d122b7b10930d617476 2 parents daca35c + 0eb80fa
José Valim josevalim authored

Showing 1 changed file with 1 addition and 3 deletions. Show diff stats Hide diff stats

  1. +1 3 actionpack/lib/action_controller/test_case.rb
4 actionpack/lib/action_controller/test_case.rb
@@ -364,9 +364,7 @@ def controller_class
364 364 end
365 365
366 366 def determine_default_controller_class(name)
367   - name.sub(/Test$/, '').constantize
368   - rescue NameError
369   - nil
  367 + name.sub(/Test$/, '').safe_constantize
370 368 end
371 369
372 370 def prepare_controller_class(new_class)

0 comments on commit 9c6d480

Please sign in to comment.
Something went wrong with that request. Please try again.