"Fossies" - the Fresh Open Source Software Archive

Member "db/migrate/20170113000001_object_manager_attribute_create_middle.rb" (25 Mar 2021, 670 Bytes) of package /linux/www/zammad-4.0.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "20170113000001_object_manager_attribute_create_middle.rb": 3.4.1_vs_3.5.0.

    1 class ObjectManagerAttributeCreateMiddle < ActiveRecord::Migration[4.2]
    2   def up
    3     # return if it's a new setup
    4     return if !Setting.exists?(name: 'system_init_done')
    5 
    6     ObjectManager::Attribute.all.each do |attribute|
    7       next if attribute.name == 'tags'
    8       next if !attribute.screens
    9       next if !attribute.screens['create_bottom']
   10 
   11       attribute.screens['create_middle'] = attribute.screens['create_bottom']
   12       attribute.screens.delete('create_bottom')
   13       attribute.save!
   14     end
   15 
   16     attribute = ObjectManager::Attribute.find_by(name: 'priority_id')
   17     attribute.data_option['nulloption'] = false
   18     attribute.save!
   19 
   20     Cache.clear
   21   end
   22 end