Permalink
Browse files

apply private method indentation convention

* tidy test code and fix my typo
  • Loading branch information...
tardate committed Jun 10, 2011
1 parent 5c7f8c9 commit 019c263633242f4329f44f863705435f58e1d884
@@ -666,7 +666,7 @@ def tables(name = nil)
SQL
end
- # Returns true of table exists.
+ # Returns true if table exists.
# If the schema is not specified as part of +name+ then it will only find tables within
# the current schema search path (regardless of permissions to access tables in other schemas)
def table_exists?(name)
@@ -981,27 +981,27 @@ def translate_exception(exception, message)
end
private
- def exec_no_cache(sql, binds)
- @connection.async_exec(sql)
- end
-
- def exec_cache(sql, binds)
- unless @statements.key? sql
- nextkey = "a#{@statements.length + 1}"
- @connection.prepare nextkey, sql
- @statements[sql] = nextkey
+ def exec_no_cache(sql, binds)
+ @connection.async_exec(sql)
end
- key = @statements[sql]
+ def exec_cache(sql, binds)
+ unless @statements.key? sql
+ nextkey = "a#{@statements.length + 1}"
+ @connection.prepare nextkey, sql
+ @statements[sql] = nextkey
+ end
- # Clear the queue
- @connection.get_last_result
- @connection.send_query_prepared(key, binds.map { |col, val|
- type_cast(val, col)
- })
- @connection.block
- @connection.get_last_result
- end
+ key = @statements[sql]
+
+ # Clear the queue
+ @connection.get_last_result
+ @connection.send_query_prepared(key, binds.map { |col, val|
+ type_cast(val, col)
+ })
+ @connection.block
+ @connection.get_last_result
+ end
# The internal PostgreSQL identifier of the money data type.
MONEY_COLUMN_TYPE_OID = 790 #:nodoc:
@@ -1106,9 +1106,9 @@ def extract_table_ref_from_insert_sql(sql)
$1.strip if $1
end
- def table_definition
- TableDefinition.new(self)
- end
+ def table_definition
+ TableDefinition.new(self)
+ end
end
end
end
@@ -11,7 +11,7 @@ def setup
end
def test_primary_key
- assert_equal 'id',@connection.primary_key('ex')
+ assert_equal 'id', @connection.primary_key('ex')
end
def test_non_standard_primary_key
@@ -225,8 +225,8 @@ def test_extract_schema_and_table
def test_current_schema
{
- %('$user',public) => 'public',
- SCHEMA_NAME => SCHEMA_NAME,
+ %('$user',public) => 'public',
+ SCHEMA_NAME => SCHEMA_NAME,
%(#{SCHEMA2_NAME},#{SCHEMA_NAME},public) => SCHEMA2_NAME,
%(public,#{SCHEMA2_NAME},#{SCHEMA_NAME}) => 'public'
}.each do |given,expect|

0 comments on commit 019c263

Please sign in to comment.