Bump pg_search from 2.0.1 to 2.3.0

Using pg_search 2.0.1 with Rails 5.2 results in deprecation warnings:

DEPRECATION WARNING: Dangerous query method (method whose arguments used
as raw SQL) called with non-attribute argument(s):
"pg_search_978c2f8941354cf552831b.rank DESC, \"tags\".\"id\" ASC".
Non-attribute arguments will be disallowed in Rails 6.0. This method
should not be called with user-provided values, such as request
parameters or model attributes. Known-safe values can be passed by
wrapping them in Arel.sql().

We're not upgrading to the latest pg_search because it only supports
ActiveRecord >= 5.2.
This commit is contained in:
Javi Martín
2020-05-29 14:26:53 +02:00
parent 17f442c723
commit 9318c4f1e9
4 changed files with 5 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ gem "omniauth-twitter", "~> 1.4.0"
gem "paperclip", "~> 5.2.1"
gem "paranoia", "~> 2.4.2"
gem "pg", "~> 0.21.0"
gem "pg_search", "~> 2.0.1"
gem "pg_search", "~> 2.3.0"
gem "puma", "~> 4.3.5"
gem "recipient_interceptor", "~> 0.2.0"
gem "redcarpet", "~> 3.4.0"

View File

@@ -396,10 +396,9 @@ GEM
parser (2.7.1.3)
ast (~> 2.4.0)
pg (0.21.0)
pg_search (2.0.1)
pg_search (2.3.0)
activerecord (>= 4.2)
activesupport (>= 4.2)
arel (>= 6)
public_suffix (4.0.1)
puma (4.3.5)
nio4r (~> 2.0)
@@ -665,7 +664,7 @@ DEPENDENCIES
paperclip (~> 5.2.1)
paranoia (~> 2.4.2)
pg (~> 0.21.0)
pg_search (~> 2.0.1)
pg_search (~> 2.3.0)
puma (~> 4.3.5)
rails (= 5.1.7)
rails-assets-leaflet!

View File

@@ -2,7 +2,7 @@ module Searchable
extend ActiveSupport::Concern
included do
include PgSearch
include PgSearch::Model
include SearchCache
pg_search_scope :pg_search, ->(query) do

View File

@@ -40,7 +40,7 @@ module ActsAsTaggableOn
Tagging.public_for_api.distinct.pluck("taggings.tag_id"))
end
include PgSearch
include PgSearch::Model
pg_search_scope :pg_search, against: :name,
using: {