Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
123456789101112 |
- class RemoveOrphanedUserCustomValues < ActiveRecord::Migration[6.1]
- def up
- user_custom_field_ids = CustomField.where(field_format: 'user').ids
- if user_custom_field_ids.any?
- user_ids = Principal.ids
- CustomValue.
- where(custom_field_id: user_custom_field_ids).
- where.not(value: [nil, ''] + user_ids).
- delete_all
- end
- end
- end
|