Skip to content

Conversation

@takayamaki
Copy link

This pull request fixes in the RulesCompressor class related to STI subclasses.

This PR may fix #874.

expexted and actual behavior

class Vehicle < ApplicationRecord; end
class Car < Vehicle; end
class Motorbike < Vehicle; end

Car.create!
Motorbike.create!

ability = Ability.new()
car = ability.can :read, Car
motorbike = ability.can :read, Motorbike

Vehicle.accessible_by(ability)
# expected => [car, motorbike]
# actual => [motorbike]
# missing => [car]

@23tux
Copy link

23tux commented Nov 11, 2025

Whats the state of this PR? We still have the issue from #874

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

STI ability overwrites previously defined STI rules

2 participants