Project is with Rails + Pundit. Fruit
class has two subclasses:
Tropical < Fruit
Temperate < Fruit
In fruit_policy.rb
I got this:
class Scope < Scope
def resolve
if user.is_near_equator
scope.where(class: Tropical)
else
scope.where(class: Temperate)
end
end
end
The class
check above gives me:
NameError (uninitialized constant Fruit::Tropical...
_________________________________________^^^^^^^^^
Is it possible to check the class within a scope in a policy? If so, how?