GRN2-xx: Switch the relation between users and roles to make queries cleaner and faster (#1299)

* First steps

* Fixes in account creation flow

* Fixed most testcases

* more test fixes

* Fixed more test cases

* Passing tests and rubocop

* Added rake task to remove rooms
This commit is contained in:
Ahmad Farhat
2020-05-06 15:23:28 -04:00
committed by GitHub
parent 8f454cad0e
commit 467947f1b5
37 changed files with 262 additions and 402 deletions

View File

@@ -19,7 +19,7 @@ class RolifyCreateRoles < ActiveRecord::Migration[5.0]
add_index(:users_roles, [:user_id, :role_id])
User.all.each do |user|
user.add_role(:user) if user.roles.blank?
user.set_role(:user) if user.roles.blank?
end
end
end