aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters
diff options
context:
space:
mode:
authorDoug Cole <doug@estately.com>2012-04-01 15:23:06 -0700
committerDoug Cole <doug@estately.com>2012-04-01 15:23:06 -0700
commit3a0d08163a76427611df0c109a5159daaf5b51bf (patch)
tree219debafa4d7a123fdd427c71aec06f675e91780 /activerecord/test/cases/adapters
parent945c53e7b54eff25e1cc1cf81ba6c96cce6664de (diff)
downloadrails-3a0d08163a76427611df0c109a5159daaf5b51bf.tar.gz
rails-3a0d08163a76427611df0c109a5159daaf5b51bf.tar.bz2
rails-3a0d08163a76427611df0c109a5159daaf5b51bf.zip
pick better names and add a little documentation
Diffstat (limited to 'activerecord/test/cases/adapters')
-rw-r--r--activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
index 1452911974..3073b9f011 100644
--- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
@@ -50,38 +50,38 @@ module ActiveRecord
end
def test_insert_sql_with_returning_disabled
- @connection.use_returning = false
+ @connection.disable_insert_returning!
id = @connection.insert_sql("insert into postgresql_partitioned_table_parent (number) VALUES (1)")
expect = @connection.query('select max(id) from postgresql_partitioned_table_parent').first.first
assert_equal expect, id
ensure
- @connection.use_returning = true
+ @connection.enable_insert_returning!
end
def test_exec_insert_with_returning_disabled
- @connection.use_returning = false
+ @connection.disable_insert_returning!
result = @connection.exec_insert("insert into postgresql_partitioned_table_parent (number) VALUES (1)", nil, [], 'id', 'postgresql_partitioned_table_parent_id_seq')
expect = @connection.query('select max(id) from postgresql_partitioned_table_parent').first.first
assert_equal expect, result.rows.first.first
ensure
- @connection.use_returning = true
+ @connection.enable_insert_returning!
end
def test_exec_insert_with_returning_disabled_and_no_sequence_name_given
- @connection.use_returning = false
+ @connection.disable_insert_returning!
result = @connection.exec_insert("insert into postgresql_partitioned_table_parent (number) VALUES (1)", nil, [], 'id')
expect = @connection.query('select max(id) from postgresql_partitioned_table_parent').first.first
assert_equal expect, result.rows.first.first
ensure
- @connection.use_returning = true
+ @connection.enable_insert_returning!
end
def test_sql_for_insert_with_returning_disabled
- @connection.use_returning = false
+ @connection.disable_insert_returning!
result = @connection.sql_for_insert('sql', nil, nil, nil, 'binds')
assert_equal ['sql', 'binds'], result
ensure
- @connection.use_returning = true
+ @connection.enable_insert_returning!
end
def test_serial_sequence