diff options
-rw-r--r-- | activerecord/lib/active_record/validations/uniqueness.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index be704f89b3..2677fade18 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -78,10 +78,7 @@ module ActiveRecord else klass.connection.case_sensitive_comparison(table, attribute, column, value) end - klass.unscoped.tap do |scope| - parts = [comparison] - scope.where_clause += Relation::WhereClause.new(parts) - end + klass.unscoped.where!(comparison) end def scope_relation(record, relation) |