diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-04 09:29:38 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-04 09:29:38 +0900 |
commit | cdc466692c8b54f786980565999a13c5241c309b (patch) | |
tree | f086367e9358a27da00d7d55756db1e66dcb3eff /activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb | |
parent | 5b469da6ec482414c5f59762ae8e82de7e07c365 (diff) | |
download | rails-cdc466692c8b54f786980565999a13c5241c309b.tar.gz rails-cdc466692c8b54f786980565999a13c5241c309b.tar.bz2 rails-cdc466692c8b54f786980565999a13c5241c309b.zip |
Make `name` and `binds` to optional args for `exec_{insert,update,delete}`
`insert`, `update`, `delete`, and `exec_query` have a default value
against `name` and `binds`. But `exec_insert`, `exec_update`, and
`exec_delete` not have. It is an inconvenience and inconsistent.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb index f5232127c4..da533463bf 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb @@ -112,7 +112,7 @@ module ActiveRecord end end - def exec_delete(sql, name = 'SQL', binds = []) + def exec_delete(sql, name = nil, binds = []) execute_and_clear(sql, name, binds) {|result| result.cmd_tuples } end alias :exec_update :exec_delete @@ -133,7 +133,7 @@ module ActiveRecord super end - def exec_insert(sql, name, binds, pk = nil, sequence_name = nil) + def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil) val = exec_query(sql, name, binds) if !use_insert_returning? && pk unless sequence_name |