Skip to content
Snippets Groups Projects
Unverified Commit ffd5af20 authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

More hotfixes (#5676)

* More hotfixes

* rubo
parent c75f20c3
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,12 @@
class AddEmailOnSignUpPermission < ActiveRecord::Migration[7.1]
def up
email_permission = Permission.create!(name: 'EmailOnSignup')
admin = Role.find_by(name: 'Administrator')
admin = Role.where(name: 'Administrator')
values = [{ role: admin, permission: email_permission, value: 'true' }]
values = []
admin.each do |adm|
values << { role: adm, permission: email_permission, value: 'true' }
end
Role.where.not(name: 'Administrator').each do |role|
values.push({ role:, permission: email_permission, value: 'false' })
......
# frozen_string_literal: true
class FixAccessToVisibilitiesValue < ActiveRecord::Migration[7.1]
def up
# rubocop:disable Rails/SkipsModelValidations
Permission.find_by(name: 'AccessToVisibilities').role_permissions.where(value: 'false').update_all(value: Recording::VISIBILITIES.values)
# rubocop:enable Rails/SkipsModelValidations
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment