Commit c86bbf36 by liyijie

fix policy_class

parent d32fb86e
......@@ -201,8 +201,9 @@ class SimpleController::BaseController < ::InheritedResources::Base
def policy_association_chain
policy_class ||= self.class.instance_variable_get(:@policy_class)
scope_policy_class = "#{policy_class}::Scope".safe_constantize
if policy_class.present? &&
scope_policy_class = "#{policy_class}::Scope".safe_constantize &&
scope_policy_class &&
origin_end_of_association_chain.is_a?(ActiveRecord::Relation)
scope_policy_class.new(current_user, origin_end_of_association_chain).resolve
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment