I am trying to get a list of all models in my app with an already defined Pundit policy.
until then , I am checking it using this code :
current_user = User.first
ActiveRecord::Base.send(:subclasses).map { |subclass| subclass.name if
Pundit.policy(current_user, subclass.new) }
but as I am using the Globalize gem, and I get the following error , on collecting , as an abstract class it cannot be instantiated
NotImplementedError: Globalize::ActiveRecord::Translation is an
abstract class and cannot be instantiated.
Is there anyway to override this error ? inserting some check in the if test before instantiating the subclass I can also remove this Globalise table from the subclass list
["HABTM_Groups", "HABTM_Roles", "HABTM_Groups", "HABTM_Roles", "User", "HABTM_Groups", "HABTM_Roles", "AccessLevel", "Company", "Document", "Group", "Globalize::ActiveRecord::Translation", "HABTM_Users", "Message", "Profile", "RestrictedActivity", "RestrictedAttribute", "Role", "HABTM_Users", "Sheet"]
thanks for feedback