Can't grant permission to all of a class #5

crystalneth opened this Issue Mar 13, 2010 · 3 comments


None yet
2 participants

crystalneth commented Mar 13, 2010

in sanctions.rb:

config.role :admin, User => Team

User.grant(:admin, Team)

Causes an exception because the following SQL was generated from this line. You can see it is expecting

vendor/plugins/sanction/app/models/sanction/role.rb:35:in `uniqueness_of_intent'

ActiveRecord::StatementInvalid: PGError: ERROR: invalid input syntax for integer: ""
: SELECT "sanction_roles".id FROM "sanction_roles" WHERE ((sanction_roles.principal_type = E'User' AND (sanction_roles.principal_id = E'' OR sanction_roles.principal_id IS NULL)) AND ( = E'admin') AND (sanction_roles.permissionable_type = E'Team' AND (sanction_roles.permissionable_id = E'' OR sanction_roles.permissionable_id IS NULL))) LIMIT 1


crystalneth commented Mar 13, 2010

The invalid sql is near the end:

sanction_roles.permissionable_id = E''


crystalneth commented Mar 13, 2010

This was a postgresql problem. Fixed in commit 442b1a7


matthewvermaak commented Mar 13, 2010

Thanks, its merged into master, and will mitigate to 1-1-stable soon.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment