Open runemadsen opened 11 years ago
Looks like it is pluralizing the join but not the column lookup. I am having the same issue.
Channel belongs to account. Account has column publishing_tab. Getting this sql error:
Mysql2::Error: Unknown column 'account.publishing_tab' in 'where clause': SELECT DISTINCT channels
.* FROM channels
INNER JOIN accounts
ON accounts
.id
= channels
.account_id
INNER JOIN user_channels
ON user_channels
.channel_id
= channels
.id
INNER JOIN capabilities
ON capabilities
.id
= user_channels
.capability_id
WHERE channels
.account_id
= 1 AND account
.publishing_tab
= 'show'
this is probably the same as #646
Try this:
can :manage, Permission, :book => { :id => press.book_ids }
Got the same error:
SELECT "projects".* FROM "projects" INNER JOIN "groups" ON "groups"."id" = "projects"."group_id" WHERE "projects"."owner_id" = 1 AND "group"."owner_id" = 1 ORDER BY progress DESC
not pluralizing "group" in WHERE clause
Ability looks like this:
can :manage, Project, :owner_id => user.id, :group => { :owner_id => user.id }
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!
I have these classes
I'm defining this ability:
And it throws this error:
It seems like it's not pluralizing the last
"book"."press_id" = 1
.Is this me, or is this a bug in CanCan?