Open davesherratt opened 12 years ago
@davesherratt Can you please post the code that causes this? For example: ability definition, version of cancan, ruby and rails and the code that's triggering it. Without all the information, it'd be hard to figure out what's causing it.
Thanks.
@andhapp here's a paste dump of the code and version http://paste2.org/p/2098389 Are there any other bits you need?
Is this still an issue, if so, could you also provide the code that is actually triggering the mentioned SQL statements (maybe RetailUsersController#new(?))?
Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013. Since only Ryan himself has commit permissions, the CanCan project is on a standstill.
CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994.
If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan.
We hope to see you on the other side!
In the developer.log I see the sql is not checking for the correct ID of the user, instead checking for is null?
Processing by RetailUsersController#new as HTML [1m[36mRetailUser Load (2.0ms)[0m [1mSELECT "retail_users".* FROM "retail_users" WHERE "retail_users"."id" = 63 LIMIT 1[0m super_admin [1m[35mRole Load (1.5ms)[0m SELECT "roles".* FROM "roles" INNER JOIN "retail_users_roles" ON "roles"."id" = "retail_users_roles"."role_id" WHERE "retail_users_roles"."retail_user_id" IS NULL AND "roles"."slug" = 'super_admin' LIMIT 1