From 329ba57fba509bdbd08f3c3c6d44f99cda66d6b0 Mon Sep 17 00:00:00 2001 From: Kane York Date: Mon, 3 Aug 2015 23:35:02 -0700 Subject: [PATCH] Fix untested code path --- plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index be5ff46..9a000bf 100644 --- a/plugin.rb +++ b/plugin.rb @@ -728,8 +728,8 @@ SQL if string.gsub(/[ _]/, '') =~ /^-?\d+$/ clazz_name = (/^(.*)_id$/.match(type.to_s)[1].classify.to_sym) begin - Object.const_get(clazz_name).find(string.gsub(/[ _]/, '').to_i) - value = pkey + object = Object.const_get(clazz_name).with_deleted.find(string.gsub(/[ _]/, '').to_i) + value = object.id rescue ActiveRecord::RecordNotFound invalid_format string, "The specified #{clazz_name} was not found" end