Commit d32fb86e by liyijie

use ActiveRecord::Relation

parent 6dadde7c
......@@ -203,7 +203,7 @@ class SimpleController::BaseController < ::InheritedResources::Base
policy_class ||= self.class.instance_variable_get(:@policy_class)
if policy_class.present? &&
scope_policy_class = "#{policy_class}::Scope".safe_constantize &&
origin_end_of_association_chain.is_a?(ActiveRecord::AssociationRelation)
origin_end_of_association_chain.is_a?(ActiveRecord::Relation)
scope_policy_class.new(current_user, origin_end_of_association_chain).resolve
else
origin_end_of_association_chain
......
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