Rails: ActiveRecord where vs merge
问题 First, I am getting the review statuses between particular dates. date_range = Date.parse(@from_date).beginning_of_day..Date.parse(@to_date).end_of_day @review_statuses = ReviewStatus.where(updated_at: date_range) Next, I need to apply an 'AND' condition. @review_cycle = params[:review_cycle] if @review_cycle.present? @review_statuses = @review_statuses.merge( ReviewStatus.where(evidence_cycle: @review_cycle) .or(ReviewStatus.where(roc_cycle: @review_cycle))) end Now for the below should I