mirror of
https://github.com/discourse/discourse.git
synced 2026-08-01 09:08:08 -05:00
DEV: Hand-pick Rails/WhereNot autofixes (#35117)
We can't enable `Rails/WhereNot` lint/autofix, because it would break code that uses mini_sql instead of AR (which rubocop, and tbh also we, can't easily differentiate) Those are safe because they either: * are executed in AR model scope definitions * are clearly chained starting from a AR model * are less-clearly chained, but still can be traced to a AR model/scope --------- Co-authored-by: Loïc Guitaut <loic@discourse.org>
This commit is contained in:
co-authored by
Loïc Guitaut
parent
e5ca38d2be
commit
a54e3208cb
@@ -258,7 +258,7 @@ class BulkImport::Base
|
||||
@last_upload_id = last_id(Upload)
|
||||
@user_ids_by_username_lower = User.unscoped.pluck(:id, :username_lower).to_h
|
||||
@usernames_by_id = User.unscoped.pluck(:id, :username).to_h
|
||||
@user_full_names_by_id = User.unscoped.where("name IS NOT NULL").pluck(:id, :name).to_h
|
||||
@user_full_names_by_id = User.unscoped.where.not(name: nil).pluck(:id, :name).to_h
|
||||
|
||||
puts "Loading categories indexes..."
|
||||
@last_category_id = last_id(Category)
|
||||
|
||||
Reference in New Issue
Block a user