Commit d00f8391 by dongxiaowei

fix: 修复 policy_class 配置失效问题

parent ac27dcaa
...@@ -292,8 +292,7 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -292,8 +292,7 @@ class SimpleController::BaseController < ::InheritedResources::Base
end end
scope_policy_class.new(current_user, policy_association_chain, **parent_objects).resolve scope_policy_class.new(current_user, policy_association_chain, **parent_objects).resolve
else else
origin_end_of_association_chain.respond_to?(:all) ? policy_association_chain
origin_end_of_association_chain.all : origin_end_of_association_chain
end end
end end
...@@ -316,7 +315,6 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -316,7 +315,6 @@ class SimpleController::BaseController < ::InheritedResources::Base
def query_association_chain def query_association_chain
if self.class.instance_variable_get(:@ransack_off) || params[:q].blank? if self.class.instance_variable_get(:@ransack_off) || params[:q].blank?
database_policy_association_chain database_policy_association_chain
# policy_association_chain
else else
ransack_association(database_policy_association_chain, params[:q]) ransack_association(database_policy_association_chain, params[:q])
end end
......
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