Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # I want to replace this code to make only 1 any_of() call.
- if params["group_id"]
- threads = threads.any_of(
- {:group_id => params[:group_id].to_i},
- {:group_id.exists => false},
- )
- end
- if params["group_ids"]
- threads = threads.any_of(
- {:group_id.in => params["group_ids"].split(",").map(&:to_i)},
- {:group_id.exists => false},
- )
- end
- def handle_threads_query(comment_threads)
- .....
Advertisement
Add Comment
Please, Sign In to add comment