diff --git a/lib/pg_search/features/tsearch.rb b/lib/pg_search/features/tsearch.rb
index <HASH>..<HASH> 100644
--- a/lib/pg_search/features/tsearch.rb
+++ b/lib/pg_search/features/tsearch.rb
@@ -42,7 +42,7 @@ module PgSearch
         # If :prefix is true, then the term will have :* appended to the end.
         # If :negated is true, then the term will have ! prepended to the front.
         terms = [
-          ('!' if negated),
+          (Compatibility.build_quoted('!') if negated),
           Compatibility.build_quoted("' "),
           term_sql,
           Compatibility.build_quoted(" '"),
Use Compatibility.build_quoted to fix <I> support

The version of Arel that Active Record <I> uses requires string literals
to be quoted.