From 1a36be390e83156940e6bd3e394152496a6c8e72 Mon Sep 17 00:00:00 2001 From: Andrey Voronkov Date: Wed, 8 Apr 2015 19:28:45 +0300 Subject: Fix uniqueness validation with out of range value --- activerecord/lib/active_record/validations/uniqueness.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index 9be4b10a55..5106f4e127 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -76,6 +76,8 @@ module ActiveRecord klass.connection.case_sensitive_comparison(table, attribute, column, value) end klass.unscoped.where(comparison) + rescue RangeError + klass.none end def scope_relation(record, table, relation) -- cgit v1.2.3