diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-01-08 10:30:59 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-01-08 11:44:29 +0900 |
commit | c90f141fb1a1f883f859d9bca8b98de2cc889006 (patch) | |
tree | 175122b0f0da4e6ffca3068db022d5fa182a54ce /activerecord/lib/active_record/connection_adapters/abstract | |
parent | 43ccebc1db072ba0c96a67de0b3db78fd8fd0973 (diff) | |
download | rails-c90f141fb1a1f883f859d9bca8b98de2cc889006.tar.gz rails-c90f141fb1a1f883f859d9bca8b98de2cc889006.tar.bz2 rails-c90f141fb1a1f883f859d9bca8b98de2cc889006.zip |
`{update|delete}_sql` are almost the same as `{update|delete}`
Simply `{update|delete}_sql` aliases to `{update|delete}`.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index 4d12c19b47..24418db2e9 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -123,11 +123,13 @@ module ActiveRecord def update(arel, name = nil, binds = []) exec_update(to_sql(arel, binds), name, binds) end + alias update_sql update # Executes the delete statement and returns the number of rows affected. def delete(arel, name = nil, binds = []) exec_delete(to_sql(arel, binds), name, binds) end + alias delete_sql delete # Returns +true+ when the connection adapter supports prepared statement # caching, otherwise returns +false+ @@ -375,16 +377,6 @@ module ActiveRecord exec_query(sql, name, binds, prepare: true) end - # Executes the update statement and returns the number of rows affected. - def update_sql(sql, name = nil) - execute(sql, name) - end - - # Executes the delete statement and returns the number of rows affected. - def delete_sql(sql, name = nil) - update_sql(sql, name) - end - def sql_for_insert(sql, pk, id_value, sequence_name, binds) [sql, binds] end |