Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #10521 from yahonda/sanitize_oracle

Remove current_adapter? from test_sanitize_sql_hash_handles_associations
  • Loading branch information...
commit d4de2c34c599a7256ba69cc3fb91ed367df4c974 2 parents 5d2c3a1 + 798cf2b
Rafael Mendonça França rafaelfranca authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 activerecord/test/cases/sanitize_test.rb
9 activerecord/test/cases/sanitize_test.rb
View
@@ -6,11 +6,10 @@ def setup
end
def test_sanitize_sql_hash_handles_associations
- if current_adapter?(:MysqlAdapter, :Mysql2Adapter)
- expected_value = "`adorable_animals`.`name` = 'Bambi'"
- else
- expected_value = "\"adorable_animals\".\"name\" = 'Bambi'"
- end
+ quoted_bambi = ActiveRecord::Base.connection.quote("Bambi")
+ quoted_column_name = ActiveRecord::Base.connection.quote_column_name("name")
+ quoted_table_name = ActiveRecord::Base.connection.quote_table_name("adorable_animals")
+ expected_value = "#{quoted_table_name}.#{quoted_column_name} = #{quoted_bambi}"
assert_equal expected_value, Binary.send(:sanitize_sql_hash, {adorable_animals: {name: 'Bambi'}})
end
Please sign in to comment.
Something went wrong with that request. Please try again.