Commit e0c656f9 by liyijie

after_association_chain should be array

parent d702c315
...@@ -209,7 +209,12 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -209,7 +209,12 @@ class SimpleController::BaseController < ::InheritedResources::Base
end end
def end_of_association_chain def end_of_association_chain
after_association_chain(policy_association_chain).order(id: :desc) _association_chain = after_association_chain(policy_association_chain)
if _association_chain.respond_to?(:order)
_association_chain.order(id: :desc)
else
_association_chain
end
end end
def collection def collection
......
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