From 36cd06810f61c99bd6a3e56b87e76fd9be9f77f1 Mon Sep 17 00:00:00 2001 From: John Gadbois Date: Mon, 30 Dec 2013 13:35:31 -0500 Subject: [PATCH] Look in base table before looking in slug table for slugged model --- lib/friendly_id/history.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/friendly_id/history.rb b/lib/friendly_id/history.rb index 77469c8b0..3fae3c86a 100644 --- a/lib/friendly_id/history.rb +++ b/lib/friendly_id/history.rb @@ -87,6 +87,7 @@ def exists_by_friendly_id?(id) private def first_by_friendly_id(id) + where(friendly_id_config.query_field => id).first || select(quoted_table_name + '.*').joins(:slugs).where(slug_history_clause(id)).first end