Commit 67f01625 by liyijie

end_of_association_chain support with policy_class scope

parent 105ab79f
......@@ -170,8 +170,13 @@ class SimpleController::BaseController < ::InheritedResources::Base
end
def end_of_association_chain
policy_class ||= self.class.instance_variable_get(:@policy_class)
if policy_class.present? && scope_policy_class = "#{policy_class}::Scope".safe_constantize
after_association_chain(scope_policy_class.new(current_user, super).resolve)
else
after_association_chain(super)
end
end
def collection
get_collection_ivar || set_collection_ivar(
......
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