diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/crud.rb | 14 |
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 |