DEV: Remove use of deprecated methods (#19486)

This commit is contained in:
Rafael dos Santos Silva 2022-12-15 22:08:05 -03:00 committed by GitHub
parent 98e3e90aa2
commit 4edeb7d9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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