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