diff --git a/lib/pg_search.rb b/lib/pg_search.rb index 594699a7..45bb85d2 100644 --- a/lib/pg_search.rb +++ b/lib/pg_search.rb @@ -108,5 +108,8 @@ def message end end -require "pg_search/document" +ActiveSupport.on_load(:active_record) do + require "pg_search/document" +end + require "pg_search/railtie" if defined?(Rails)