Commit d6f5d531 by liyijie

distinct_on default is off

parent 8b70b6c3
......@@ -136,7 +136,7 @@ class SimpleController::BaseController < ::InheritedResources::Base
def ransack_paginate(association)
association = association.ransack(params[:q]).result unless self.class.instance_variable_get(:@ransack_off)
association = association.distinct unless self.class.instance_variable_get(:@distinct_on)
association = association.distinct if self.class.instance_variable_get(:@distinct_on)
association = association.paginate(page: params[:page], per_page: params[:per_page]) unless self.class.instance_variable_get(:@paginate_off)
association
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