lib/rubocop/cop/rails/where_range.rb in rubocop-rails-2.26.0 vs lib/rubocop/cop/rails/where_range.rb in rubocop-rails-2.26.1

- old
+ new

@@ -138,20 +138,25 @@ lhs = pair1.value operator = range_operator(Regexp.last_match(3)) rhs = pair2.value end end + else + return end if lhs lhs_source = parentheses_needed?(lhs) ? "(#{lhs.source})" : lhs.source end if rhs rhs_source = parentheses_needed?(rhs) ? "(#{rhs.source})" : rhs.source end - [Regexp.last_match(1), "#{lhs_source}#{operator}#{rhs_source}"] if operator + column_qualifier = Regexp.last_match(1) + return if column_qualifier.count('.') > 1 + + [column_qualifier, "#{lhs_source}#{operator}#{rhs_source}"] if operator end # rubocop:enable Metrics def range_operator(comparison_operator) comparison_operator == '<' ? '...' : '..'