aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations
diff options
context:
space:
mode:
authorAndrey Voronkov <andrey.voronkov@medm.com>2015-04-08 19:28:45 +0300
committerAndrey Voronkov <andrey.voronkov@medm.com>2015-04-08 19:28:45 +0300
commit1a36be390e83156940e6bd3e394152496a6c8e72 (patch)
treef72b26bae158456f12fea0a46ef011cd888ccc82 /activerecord/lib/active_record/validations
parent0a120a818d413c64ff9867125f0b03788fc306f8 (diff)
downloadrails-1a36be390e83156940e6bd3e394152496a6c8e72.tar.gz
rails-1a36be390e83156940e6bd3e394152496a6c8e72.tar.bz2
rails-1a36be390e83156940e6bd3e394152496a6c8e72.zip
Fix uniqueness validation with out of range value
Diffstat (limited to 'activerecord/lib/active_record/validations')
-rw-r--r--activerecord/lib/active_record/validations/uniqueness.rb2
1 files changed, 2 insertions, 0 deletions
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)