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:
2
Gemfile
2
Gemfile
@@ -40,7 +40,7 @@ gem "omniauth-twitter", "~> 1.4.0"
|
|||||||
gem "paperclip", "~> 5.2.1"
|
gem "paperclip", "~> 5.2.1"
|
||||||
gem "paranoia", "~> 2.4.2"
|
gem "paranoia", "~> 2.4.2"
|
||||||
gem "pg", "~> 0.21.0"
|
gem "pg", "~> 0.21.0"
|
||||||
gem "pg_search", "~> 2.0.1"
|
gem "pg_search", "~> 2.3.0"
|
||||||
gem "puma", "~> 4.3.5"
|
gem "puma", "~> 4.3.5"
|
||||||
gem "recipient_interceptor", "~> 0.2.0"
|
gem "recipient_interceptor", "~> 0.2.0"
|
||||||
gem "redcarpet", "~> 3.4.0"
|
gem "redcarpet", "~> 3.4.0"
|
||||||
|
|||||||
@@ -396,10 +396,9 @@ GEM
|
|||||||
parser (2.7.1.3)
|
parser (2.7.1.3)
|
||||||
ast (~> 2.4.0)
|
ast (~> 2.4.0)
|
||||||
pg (0.21.0)
|
pg (0.21.0)
|
||||||
pg_search (2.0.1)
|
pg_search (2.3.0)
|
||||||
activerecord (>= 4.2)
|
activerecord (>= 4.2)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
arel (>= 6)
|
|
||||||
public_suffix (4.0.1)
|
public_suffix (4.0.1)
|
||||||
puma (4.3.5)
|
puma (4.3.5)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
@@ -665,7 +664,7 @@ DEPENDENCIES
|
|||||||
paperclip (~> 5.2.1)
|
paperclip (~> 5.2.1)
|
||||||
paranoia (~> 2.4.2)
|
paranoia (~> 2.4.2)
|
||||||
pg (~> 0.21.0)
|
pg (~> 0.21.0)
|
||||||
pg_search (~> 2.0.1)
|
pg_search (~> 2.3.0)
|
||||||
puma (~> 4.3.5)
|
puma (~> 4.3.5)
|
||||||
rails (= 5.1.7)
|
rails (= 5.1.7)
|
||||||
rails-assets-leaflet!
|
rails-assets-leaflet!
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module Searchable
|
|||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
include PgSearch
|
include PgSearch::Model
|
||||||
include SearchCache
|
include SearchCache
|
||||||
|
|
||||||
pg_search_scope :pg_search, ->(query) do
|
pg_search_scope :pg_search, ->(query) do
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ module ActsAsTaggableOn
|
|||||||
Tagging.public_for_api.distinct.pluck("taggings.tag_id"))
|
Tagging.public_for_api.distinct.pluck("taggings.tag_id"))
|
||||||
end
|
end
|
||||||
|
|
||||||
include PgSearch
|
include PgSearch::Model
|
||||||
|
|
||||||
pg_search_scope :pg_search, against: :name,
|
pg_search_scope :pg_search, against: :name,
|
||||||
using: {
|
using: {
|
||||||
|
|||||||
Reference in New Issue
Block a user