Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filter :groups_id, :as => :check_boxes, :collection => proc {Group.all}
- class MyModel
- has_and_belongs_to_many :things, :uniq => true
- end
- distinct: true
- controller do
- def apply_filtering(chain)
- @search = chain.ransack clean_search_params params[:q]
- @search.result(distinct: true)
- end
- end
- def apply_filtering(chain)
- super
- @search.result(distinct: true)
- end
Add Comment
Please, Sign In to add comment