You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To expand a little on the above, I noticed doing a user.role_list builds this SQL query:
SELECT`royce_role`.`name` FROM `royce_role` INNER JOIN `royce_connector` ON `royce_role`.`id` = `royce_connector`.`role_id` WHERE `royce_connector`.`roleable_id` = 641702 AND `royce_connector`.`roleable_type` ='User'
and the crud_role.admins.all builds this SQL query
SELECT`users`.* FROM`users`INNERJOIN`royce_connector`ON`users`.`id` = `royce_connector`.`roleable_id` WHERE `users`.`type` IN ('Admin') AND `royce_connector`.`role_id` = 1 AND `royce_connector`.`roleable_type` ='Admin'
As mentioned in above note, the roleable_type here is stored as 'User' allowing the role_list to work, but not the named scopes as mentioned above.
If I have a subclass of User, say Admin, with royce_roles [:add, :edit, :delete, :crud], the following gives me empty collections:
Looking in SQL, royce_connector shows User as roleable_type instead of Admin which is what is causing the empty sets.
The text was updated successfully, but these errors were encountered: