diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-09-06 18:33:14 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-09-06 18:33:14 +0000 |
commit | 55ce8de0aea23397aafdee68e4e7be1beb6089a9 (patch) | |
tree | dd8c500a587abd8865b889ccb00ede1329ff55b0 /db | |
parent | 4378b7e1b47311aa1f7cf4992321dc0cbd9e5830 (diff) | |
download | redmine-55ce8de0aea23397aafdee68e4e7be1beb6089a9.tar.gz redmine-55ce8de0aea23397aafdee68e4e7be1beb6089a9.zip |
Use ids instead of pluck(:id) (#32977).
git-svn-id: http://svn.redmine.org/redmine/trunk@21208 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210801211024_remove_orphaned_user_custom_values.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20210801211024_remove_orphaned_user_custom_values.rb b/db/migrate/20210801211024_remove_orphaned_user_custom_values.rb index 446ef7f10..7d886321d 100644 --- a/db/migrate/20210801211024_remove_orphaned_user_custom_values.rb +++ b/db/migrate/20210801211024_remove_orphaned_user_custom_values.rb @@ -1,8 +1,8 @@ class RemoveOrphanedUserCustomValues < ActiveRecord::Migration[6.1] def up - user_custom_field_ids = CustomField.where(field_format: 'user').pluck(:id) + user_custom_field_ids = CustomField.where(field_format: 'user').ids if user_custom_field_ids.any? - user_ids = Principal.pluck(:id) + user_ids = Principal.ids CustomValue. where(custom_field_id: user_custom_field_ids). where.not(value: [nil, ''] + user_ids). |