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
When using Vehicle.accessible_by(ability, :index) I would expect to have access to all vehicles, the generated SQL produces an OR statement in cancancan 3.5.0 but truncates the statement to only include the last defined can :index, XXXX rule.
Steps to reproduce
The order of
can
statements affects the SQL that is generated:Expected behavior
When using
Vehicle.accessible_by(ability, :index)
I would expect to have access to all vehicles, the generated SQL produces anOR
statement in cancancan 3.5.0 but truncates the statement to only include the last definedcan :index, XXXX
rule.Actual behavior
Demonstrated best by looking at the SQL:
Switching the order of the can statements:
IMO it should not matter, in which order the can statements are written.
System configuration
Rails version: Tested in 7.1 and 7.2
Ruby version: 3.3.3
CanCanCan version 3.6.1
The text was updated successfully, but these errors were encountered: