Sha256: 3bf7b44a7920f9f74d58971570a8f52475de5cf58d946191ed626a2f101159ce

Contents?: true

Size: 1019 Bytes

Versions: 96

Compression:

Stored size: 1019 Bytes

Contents

class AddPermissionsToEducodeSalesPermissions < ActiveRecord::Migration[5.2]
  def change
    last_position = EducodeSales::Permission.all.order(position: :asc).last.position
    EducodeSales::Permission.create(name: '查看方案', subject: 'Idea', action: 'read', clazz: 'idea', position: last_position + 1)
    EducodeSales::Permission.create(name: '添加方案', subject: 'Idea', action: 'create', clazz: 'idea', position: last_position + 2)
    EducodeSales::Permission.create(name: '编辑方案', subject: 'Idea', action: 'update', clazz: 'idea', position: last_position + 3)
    EducodeSales::Permission.create(name: '移除方案', subject: 'Idea', action: 'destroy', clazz: 'idea', position: last_position + 4)
    EducodeSales::Permission.create(name: '恢复方案', subject: 'Idea', action: 'recycle', clazz: 'idea', position: last_position + 5)
    EducodeSales::Permission.create(name: '查看历史记录', subject: 'Idea', action: 'read_history', clazz: 'idea', position: last_position + 6)
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
educode_sales-1.10.74 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.73 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.72 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.71 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.70 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.59 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.58 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.49 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.48 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.46 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.41 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.37 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.36 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.35 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.34 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.33 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.31 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.30 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.29 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-1.10.28 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb