diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-01 09:11:30 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-01 09:11:30 -0800 |
commit | b68bf40ecc611a75f3b204fada4471e9af92ce40 (patch) | |
tree | 66370a41b93400d1aa0774bb61c3ceb10c15bb3e /lib | |
parent | c9fe1b3e2b6124bf5c6df27b89d9efa1e58fdd9c (diff) | |
download | rails-b68bf40ecc611a75f3b204fada4471e9af92ce40.tar.gz rails-b68bf40ecc611a75f3b204fada4471e9af92ce40.tar.bz2 rails-b68bf40ecc611a75f3b204fada4471e9af92ce40.zip |
make sure we raise type errors with unknown classes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/visitors/visitor.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/arel/visitors/visitor.rb b/lib/arel/visitors/visitor.rb index 8cea42028e..055acf9765 100644 --- a/lib/arel/visitors/visitor.rb +++ b/lib/arel/visitors/visitor.rb @@ -18,6 +18,7 @@ module Arel superklass = object.class.ancestors.find { |klass| respond_to?(DISPATCH[klass], true) } + raise(TypeError, "Cannot visit #{object.class}") unless superklass DISPATCH[object.class] = DISPATCH[superklass] retry end |