From a8521641d5d7630bba7620ce42fe7456eeff0398 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 2 Dec 2010 14:31:37 -0800 Subject: deprecating the update method in favor of compile_update --- lib/arel/crud.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/arel') diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb index 8de008c09e..06883d9ac6 100644 --- a/lib/arel/crud.rb +++ b/lib/arel/crud.rb @@ -2,8 +2,7 @@ module Arel ### # FIXME hopefully we can remove this module Crud - # FIXME: this method should go away - def update values + def compile_update values um = UpdateManager.new @engine if Nodes::SqlLiteral === values @@ -16,7 +15,19 @@ module Arel um.take @ast.limit um.order(*@ast.orders) um.wheres = @ctx.wheres + um + end + + # FIXME: this method should go away + def update values + if $VERBOSE + warn <<-eowarn +update (#{caller.first}) is deprecated and will be removed in ARel 2.2.0. Please +switch to `compile_update` + eowarn + end + um = compile_update values @engine.connection.update um.to_sql, 'AREL' end -- cgit v1.2.3