lib/rolify/adapters/base.rb in rolify-3.4.0 vs lib/rolify/adapters/base.rb in rolify-3.4.1
- old
+ new
@@ -21,9 +21,13 @@
def self.create(adapter, role_cname, user_cname)
load "rolify/adapters/#{Rolify.orm}/#{adapter}.rb"
load "rolify/adapters/#{Rolify.orm}/scopes.rb"
Rolify::Adapter.const_get(adapter.camelize.to_sym).new(role_cname, user_cname)
end
+
+ def relation_types_for(relation)
+ relation.descendants.map(&:to_s).push(relation.to_s)
+ end
end
class RoleAdapterBase < Adapter::Base
def where(relation, args)
raise NotImplementedError.new("You must implement where")
\ No newline at end of file