mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 04:03:57 -06:00
DEV: Remove use of deprecated methods (#19486)
This commit is contained in:
parent
98e3e90aa2
commit
4edeb7d9eb
@ -252,7 +252,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
scope :filter_by_username_or_email, ->(filter) do
|
scope :filter_by_username_or_email, ->(filter) do
|
||||||
if filter =~ /.+@.+/
|
if filter.is_a?(String) && filter =~ /.+@.+/
|
||||||
# probably an email so try the bypass
|
# probably an email so try the bypass
|
||||||
if user_id = UserEmail.where("lower(email) = ?", filter.downcase).pluck_first(:user_id)
|
if user_id = UserEmail.where("lower(email) = ?", filter.downcase).pluck_first(:user_id)
|
||||||
return where('users.id = ?', user_id)
|
return where('users.id = ?', user_id)
|
||||||
|
@ -929,7 +929,7 @@ RSpec.describe Stylesheet::Manager do
|
|||||||
|
|
||||||
after do
|
after do
|
||||||
path = Stylesheet::Manager.send(:manifest_full_path)
|
path = Stylesheet::Manager.send(:manifest_full_path)
|
||||||
File.delete(path) if File.exists?(path)
|
File.delete(path) if File.exist?(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns a hash" do
|
it "returns a hash" do
|
||||||
|
Loading…
Reference in New Issue
Block a user