Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
019c2636
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
019c2636
编写于
6月 10, 2011
作者:
P
Paul Gallagher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apply private method indentation convention
* tidy test code and fix my typo
上级
5c7f8c92
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
25 deletion
+25
-25
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
...b/active_record/connection_adapters/postgresql_adapter.rb
+22
-22
activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
...test/cases/adapters/postgresql/postgresql_adapter_test.rb
+1
-1
activerecord/test/cases/adapters/postgresql/schema_test.rb
activerecord/test/cases/adapters/postgresql/schema_test.rb
+2
-2
未找到文件。
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
浏览文件 @
019c2636
...
...
@@ -666,7 +666,7 @@ def tables(name = nil)
SQL
end
# Returns true
o
f table exists.
# Returns true
i
f 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
activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
浏览文件 @
019c2636
...
...
@@ -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
...
...
activerecord/test/cases/adapters/postgresql/schema_test.rb
浏览文件 @
019c2636
...
...
@@ -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
|
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录