Add before_where and before_order_by on Query