aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-02 15:45:00 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-02 15:45:00 -0800
commit9e05f7e01be3840b1a66bbda0292f97740f6947e (patch)
tree3f88658602addf4104dcd3afbd45328e904fe078 /lib
parenta8521641d5d7630bba7620ce42fe7456eeff0398 (diff)
downloadrails-9e05f7e01be3840b1a66bbda0292f97740f6947e.tar.gz
rails-9e05f7e01be3840b1a66bbda0292f97740f6947e.tar.bz2
rails-9e05f7e01be3840b1a66bbda0292f97740f6947e.zip
deprecating the "delete" method in favor of compile_delete
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/crud.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb
index 06883d9ac6..ade1b9f424 100644
--- a/lib/arel/crud.rb
+++ b/lib/arel/crud.rb
@@ -48,11 +48,21 @@ switch to `compile_insert`
@engine.connection.insert compile_insert(values).to_sql
end
- def delete
+ def compile_delete
dm = DeleteManager.new @engine
dm.wheres = @ctx.wheres
dm.from @ctx.froms
- @engine.connection.delete dm.to_sql, 'AREL'
+ dm
+ end
+
+ def delete
+ if $VERBOSE
+ warn <<-eowarn
+delete (#{caller.first}) is deprecated and will be removed in ARel 2.2.0. Please
+switch to `compile_delete`
+ eowarn
+ end
+ @engine.connection.delete compile_delete.to_sql, 'AREL'
end
end
end