Sha256: 215b1e434ae2925ca3bf1ccbf6c0acbc435fb170c6944c13d04ad6df66f53fee

Contents?: true

Size: 430 Bytes

Versions: 178

Compression:

Stored size: 430 Bytes

Contents

class AddPositionToCommons < ActiveRecord::Migration[5.2]
  def change
    add_column :educode_sales_permissions, :position, :integer
    EducodeSales::Permission.all.each_with_index do |d,index|
      if d.clazz == '销售态势' || d.clazz == '销售分工' || d.clazz == '商机管理' || d.clazz == '客户管理'
        d.update(position: index)
      else
        d.update(position: index * 10)
      end
    end
  end
end

Version data entries

178 entries across 178 versions & 1 rubygems

Version Path
educode_sales-0.9.95 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.94 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.93 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.92 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.91 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.90 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.89 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.86 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.84 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.83 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.82 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.81 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.80 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.79 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.78 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.77 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.76 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.75 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.74 db/migrate/20211220102720_add_position_to_commons.rb
educode_sales-0.9.73 db/migrate/20211220102720_add_position_to_commons.rb