aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-24 13:06:12 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-24 13:06:12 +0000
commit566a36966b43d4f76e6a4e6dfa0d12112cbe46b4 (patch)
tree5ecfdbf8ef8de170f09feda82c92d9e52fb7560a /activerecord/lib/active_record
parent93ec1303779a238754c87572e6e96d32133cee86 (diff)
downloadrails-566a36966b43d4f76e6a4e6dfa0d12112cbe46b4.tar.gz
rails-566a36966b43d4f76e6a4e6dfa0d12112cbe46b4.tar.bz2
rails-566a36966b43d4f76e6a4e6dfa0d12112cbe46b4.zip
Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@489 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 0309f03a5a..51ee251871 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -368,7 +368,7 @@ module ActiveRecord #:nodoc:
# A subset of the records can be selected by specifying +conditions+. Example:
# Billing.update_all "category = 'authorized', approved = 1", "author = 'David'"
def update_all(updates, conditions = nil)
- sql = "UPDATE #{table_name} SET #{updates} "
+ sql = "UPDATE #{table_name} SET #{sanitize_sql(updates)} "
add_conditions!(sql, conditions)
return connection.update(sql, "#{name} Update")
end