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