1
0
Fork 0
forked from OpenNeo/impress

Remove sanitize_sql_like monkey-patch

I had added this many Rails versions ago during the recent upgrade process, because it was in latest Rails but not in the version of Rails I was using when replacing Elasticsearch with MySQL queries. We can remove it now!
This commit is contained in:
Emi Matchu 2023-08-04 17:21:38 -07:00
parent d8eea93c1c
commit 0e4cc80ac8
3 changed files with 0 additions and 18 deletions

View file

@ -47,10 +47,4 @@ class Color < ApplicationRecord
now = Time.now.in_time_zone('Pacific Time (US & Canada)')
now.month == 4 && now.day == 1
end
# TODO: Copied from modern Rails source, can delete once we're there!
def self.sanitize_sql_like(string, escape_character = "\\")
pattern = Regexp.union(escape_character, "%", "_")
string.gsub(pattern) { |x| [escape_character, x].join }
end
end

View file

@ -634,10 +634,4 @@ class Item < ApplicationRecord
def self.build_proxies(ids)
Item::ProxyArray.new(ids)
end
# TODO: Copied from modern Rails source, can delete once we're there!
def self.sanitize_sql_like(string, escape_character = "\\")
pattern = Regexp.union(escape_character, "%", "_")
string.gsub(pattern) { |x| [escape_character, x].join }
end
end

View file

@ -29,10 +29,4 @@ class Species < ApplicationRecord
I18n.translate('species.default_human_name')
end
end
# TODO: Copied from modern Rails source, can delete once we're there!
def self.sanitize_sql_like(string, escape_character = "\\")
pattern = Regexp.union(escape_character, "%", "_")
string.gsub(pattern) { |x| [escape_character, x].join }
end
end