From a712e08ebe21f6d8653a0e6602df2e0f5d40d9ca Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Wed, 6 Feb 2013 13:19:09 -0500 Subject: active_record: Quote numeric values compared to string columns. --- activerecord/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 55fa9cae81..e102adcb4d 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,15 @@ ## Rails 4.0.0 (unreleased) ## +* Quote numeric values being compared to non-numeric columns. Otherwise, + in some database, the string column values will be coerced to a numeric + allowing 0, 0.0 or false to match any string starting with a non-digit. + + Example: + + App.where(apikey: 0) # => SELECT * FROM users WHERE apikey = '0' + + *Dylan Smith* + * Schema dumper supports dumping the enabled database extensions to `schema.rb` (currently only supported by postgresql). -- cgit v1.2.3