lib/pragma/macro/policy.rb in pragma-2.4.0 vs lib/pragma/macro/policy.rb in pragma-2.5.0
- old
+ new
@@ -8,10 +8,12 @@
end
module Policy
class << self
def for(input, name, options, action = nil)
- policy = options["policy.#{name}.class"].new(
+ klass = Macro.require_skill('Policy', "policy.#{name}.class", options)
+
+ policy = klass.new(
options['policy.context'] || options['current_user'],
options['model']
)
action_name = action.is_a?(Proc) ? action.call(options) : action