Commit 7232e2f5 by Sammy Larbi

Fix `NameError: wrong constant name` on Ruby 1.9

Ruby 1.9's version of `Object.const_get` does not support namespaced constants, so this commit replaces it with `ActiveSupport`'s `#constantize` method.

The tests were failing running JRuby on 1.9 mode. CRuby was not failing because it is not tested against 1.9.
parent b6d60b55
......@@ -154,7 +154,7 @@ module Paranoia
association_find_conditions = { association_foreign_key => self.id }
end
association_class = Object.const_get(association_class_name)
association_class = association_class_name.constantize
if association_class.paranoid?
association_class.only_deleted.where(association_find_conditions).first.try!(:restore, recursive: true)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment