Guest User

Untitled

a guest
Jul 11th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.43 KB | None | 0 0
  1. # I want to replace this code to make only 1 any_of() call.
  2.   if params["group_id"]
  3.     threads = threads.any_of(
  4.       {:group_id => params[:group_id].to_i},
  5.       {:group_id.exists => false},
  6.     )
  7.   end
  8.   if params["group_ids"]
  9.     threads = threads.any_of(
  10.       {:group_id.in => params["group_ids"].split(",").map(&:to_i)},
  11.       {:group_id.exists => false},
  12.     )
  13.   end
  14.  
  15. def handle_threads_query(comment_threads)
  16. .....
Advertisement
Add Comment
Please, Sign In to add comment