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-0.9.95 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.94 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.93 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.92 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.91 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.90 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.89 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.86 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.84 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.83 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.82 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.81 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.80 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.79 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.78 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.77 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.76 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.75 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.74 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb
educode_sales-0.9.73 db/migrate/20230308022633_add_permissions_to_educode_sales_permissions.rb