aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/validations.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index e7a9676394..b7e6394748 100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -629,12 +629,11 @@ module ActiveRecord
if value.nil?
comparison_operator = "IS ?"
- else
+ elsif is_text_column
comparison_operator = "#{connection.case_sensitive_equality_operator} ?"
-
- if is_text_column
- value = value.to_s
- end
+ value = value.to_s
+ else
+ comparison_operator = "= ?"
end
sql_attribute = "#{record.class.quoted_table_name}.#{connection.quote_column_name(attr_name)}"