pools: stop using the pool_string field (#4160).
Stop using the pool_string field internally, but keep maintaining it until we can drop it later. * Stop using the pool_string for `pool:<name>` metatag searches. * Stop using the pool_string in the `Post#pools` method. This is used to get the list of pools on post show pages.
This commit is contained in:
@@ -112,16 +112,20 @@ class Pool < ApplicationRecord
|
||||
normalize_name(name).mb_chars.downcase
|
||||
end
|
||||
|
||||
def self.find_by_name(name)
|
||||
def self.named(name)
|
||||
if name =~ /^\d+$/
|
||||
where("pools.id = ?", name.to_i).first
|
||||
where("pools.id = ?", name.to_i)
|
||||
elsif name
|
||||
where_ilike(:name, normalize_name_for_search(name)).first
|
||||
where_ilike(:name, normalize_name_for_search(name))
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def self.find_by_name(name)
|
||||
named(name).try(:first)
|
||||
end
|
||||
|
||||
def versions
|
||||
if PoolArchive.enabled?
|
||||
PoolArchive.where("pool_id = ?", id).order("id asc")
|
||||
|
||||
Reference in New Issue
Block a user