aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPaul Gallagher <gallagher.paul@gmail.com>2011-06-10 22:48:58 +0800
committerPaul Gallagher <gallagher.paul@gmail.com>2011-06-10 22:48:58 +0800
commit019c263633242f4329f44f863705435f58e1d884 (patch)
treecd6b87d0b27d6edbd81f2234e52e0959f6d5d536 /activerecord
parent5c7f8c929b228063b224eaa17360dcc105788296 (diff)
downloadrails-019c263633242f4329f44f863705435f58e1d884.tar.gz
rails-019c263633242f4329f44f863705435f58e1d884.tar.bz2
rails-019c263633242f4329f44f863705435f58e1d884.zip
apply private method indentation convention
* tidy test code and fix my typo
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb44
-rw-r--r--activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb2
-rw-r--r--activerecord/test/cases/adapters/postgresql/schema_test.rb4
3 files changed, 25 insertions, 25 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 2a3ee33e3e..0ef871749f 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -666,7 +666,7 @@ module ActiveRecord
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 @@ module ActiveRecord
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 @@ module ActiveRecord
$1.strip if $1
end
- def table_definition
- TableDefinition.new(self)
- end
+ def table_definition
+ TableDefinition.new(self)
+ end
end
end
end
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
index b113267dca..9943cd18f6 100644
--- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
@@ -11,7 +11,7 @@ module ActiveRecord
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
diff --git a/activerecord/test/cases/adapters/postgresql/schema_test.rb b/activerecord/test/cases/adapters/postgresql/schema_test.rb
index d4797e1680..a12f689802 100644
--- a/activerecord/test/cases/adapters/postgresql/schema_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/schema_test.rb
@@ -225,8 +225,8 @@ class SchemaTest < ActiveRecord::TestCase
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|