I'm trying to create a new hash from params
. I'm doing something like this:
where_query = { active: true }
where_query[:brand_ids] = params[:brand_ids].split(',') if params[:brand_ids].present?
where_query[:market_id] = params[:market_id] if params[:market_id].present?
Is that okay? Or is there a better way to do that?