mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -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
|
||||
|
||||
scope :filter_by_username_or_email, ->(filter) do
|
||||
if filter =~ /.+@.+/
|
||||
if filter.is_a?(String) && filter =~ /.+@.+/
|
||||
# probably an email so try the bypass
|
||||
if user_id = UserEmail.where("lower(email) = ?", filter.downcase).pluck_first(:user_id)
|
||||
return where('users.id = ?', user_id)
|
||||
|
@ -929,7 +929,7 @@ RSpec.describe Stylesheet::Manager do
|
||||
|
||||
after do
|
||||
path = Stylesheet::Manager.send(:manifest_full_path)
|
||||
File.delete(path) if File.exists?(path)
|
||||
File.delete(path) if File.exist?(path)
|
||||
end
|
||||
|
||||
it "returns a hash" do
|
||||
|
Loading…
Reference in New Issue
Block a user