Commit 4b21ef4a by liyijie

Add distinct to collection

parent fc265d42
...@@ -53,7 +53,7 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -53,7 +53,7 @@ class SimpleController::BaseController < ::InheritedResources::Base
get_collection_ivar || set_collection_ivar( get_collection_ivar || set_collection_ivar(
after_association_chain(end_of_association_chain).ransack( after_association_chain(end_of_association_chain).ransack(
params[:q] params[:q]
).result.paginate( ).result.distinct.paginate(
page: params[:page], per_page: params[:per_page] page: params[:page], per_page: params[:per_page]
) )
) )
......
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