Open 23tux opened 2 years ago
Unfortunately, I still have no solution to this and the update to cancancan 3.4.0 didn't resolve it either. Can someone help me, figuring this out?
I just tried cancancan 3.5.0 and I still have the same issue. Was hoping that this fix would also fix my issue https://github.com/CanCanCommunity/cancancan/pull/814
Can someone from the team help me figure out what's wrong here?
Steps to reproduce
My ability has this line
The models look like this:
Expected behavior
When I use
EventImage.accessible_by(current_ability)
it generates this SQL:And this results in this error
Actual behavior
I guess there is something wrong with the renaming of the table, but I'm not sure if it is a problem at rails or cancancan. The problematic part is this:
It seems that somehow the
spree_time_items
table gets renamed totime_items_spree_events
, but is later referenced by it's original name in the query, thus resulting in the error above.When using Rails 6.0.4.8 this generates the following SQL which works as expected:
System configuration
Rails version: 6.1.6
Ruby version: 2.7.2
CanCanCan version: 3.3.0