Guest User

Untitled

a guest
Jun 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. filter :groups_id, :as => :check_boxes, :collection => proc {Group.all}
  2.  
  3. class MyModel
  4. has_and_belongs_to_many :things, :uniq => true
  5. end
  6.  
  7. distinct: true
  8.  
  9. controller do
  10. def apply_filtering(chain)
  11. @search = chain.ransack clean_search_params params[:q]
  12. @search.result(distinct: true)
  13. end
  14. end
  15.  
  16. def apply_filtering(chain)
  17. super
  18. @search.result(distinct: true)
  19. end
Add Comment
Please, Sign In to add comment