20220622110749_issue4012_missing_rows_for_textarea_fields.rb 494 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4012MissingRowsForTextareaFields < ActiveRecord::Migration[6.1]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. ObjectManager::Attribute
  6. .where(data_type: 'textarea', editable: true)
  7. .each do |attribute|
  8. next if attribute.data_option[:rows].is_a?(Integer)
  9. attribute.data_option[:rows] = 4
  10. attribute.save!(validate: false)
  11. end
  12. end
  13. end