Sha256: 8be2a98f72b05767b0586836717f153387ac34a011c8c4503c6e59ab091a27e8
Contents?: true
Size: 440 Bytes
Versions: 46
Compression:
Stored size: 440 Bytes
Contents
module Controller module PunditNamespacedAuthorizeConcern extend ActiveSupport::Concern included do helper_method :engine_policy end def authorize(policy, action, namespace = nil) policy = "#{namespace}::#{policy.to_s.camelize}".to_sym if namespace.present? super(policy, action) end def engine_policy(engine) policy_name = engine.name.to_sym policy(policy_name) end end end
Version data entries
46 entries across 46 versions & 1 rubygems