Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
434ec237
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,发现更多精彩内容 >>
提交
434ec237
编写于
1月 14, 2016
作者:
S
Sean Griffin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #23048 from kamipo/substitute_at_is_no_longer_used
`substitute_at` is no longer used
上级
f138bea5
a557ab00
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
3 addition
and
20 deletion
+3
-20
activerecord/lib/active_record/associations/join_dependency/join_association.rb
...e_record/associations/join_dependency/join_association.rb
+1
-2
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
...lib/active_record/connection_adapters/abstract_adapter.rb
+0
-6
activerecord/lib/active_record/relation.rb
activerecord/lib/active_record/relation.rb
+1
-1
activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
...test/cases/adapters/postgresql/postgresql_adapter_test.rb
+0
-5
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
...ecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
+0
-5
activerecord/test/cases/bind_parameter_test.rb
activerecord/test/cases/bind_parameter_test.rb
+1
-1
未找到文件。
activerecord/lib/active_record/associations/join_dependency/join_association.rb
浏览文件 @
434ec237
...
...
@@ -74,9 +74,8 @@ def join_constraints(foreign_table, foreign_klass, node, join_type, tables, scop
value
=
foreign_klass
.
base_class
.
name
column
=
klass
.
columns_hash
[
reflection
.
type
.
to_s
]
substitute
=
klass
.
connection
.
substitute_at
(
column
)
binds
<<
Relation
::
QueryAttribute
.
new
(
column
.
name
,
value
,
klass
.
type_for_attribute
(
column
.
name
))
constraint
=
constraint
.
and
table
[
reflection
.
type
].
eq
substitute
constraint
=
constraint
.
and
table
[
reflection
.
type
].
eq
(
Arel
::
Nodes
::
BindParam
.
new
)
end
joins
<<
table
.
create_join
(
table
,
table
.
create_on
(
constraint
),
join_type
)
...
...
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
浏览文件 @
434ec237
...
...
@@ -311,12 +311,6 @@ def index_algorithms
{}
end
# Returns a bind substitution value given a bind +column+
# NOTE: The column param is currently being used by the sqlserver-adapter
def
substitute_at
(
column
,
_unused
=
0
)
Arel
::
Nodes
::
BindParam
.
new
end
# REFERENTIAL INTEGRITY ====================================
# Override to turn off referential integrity while executing <tt>&block</tt>.
...
...
activerecord/lib/active_record/relation.rb
浏览文件 @
434ec237
...
...
@@ -99,7 +99,7 @@ def substitute_values(values) # :nodoc:
end
substitutes
=
values
.
map
do
|
(
arel_attr
,
_
)
|
[
arel_attr
,
connection
.
substitute_at
(
klass
.
columns_hash
[
arel_attr
.
name
])
]
[
arel_attr
,
Arel
::
Nodes
::
BindParam
.
new
]
end
[
substitutes
,
binds
]
...
...
activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
浏览文件 @
434ec237
...
...
@@ -322,11 +322,6 @@ def test_exec_typecasts_bind_vals
end
end
def
test_substitute_at
bind
=
@connection
.
substitute_at
(
nil
)
assert_equal
Arel
.
sql
(
'$1'
),
bind
.
to_sql
end
def
test_partial_index
with_example_table
do
@connection
.
add_index
'ex'
,
%w{ id number }
,
:name
=>
'partial'
,
:where
=>
"number > 100"
...
...
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
浏览文件 @
434ec237
...
...
@@ -130,11 +130,6 @@ def test_encoding
assert_equal
'UTF-8'
,
@conn
.
encoding
end
def
test_bind_value_substitute
bind_param
=
@conn
.
substitute_at
(
'foo'
)
assert_equal
Arel
.
sql
(
'?'
),
bind_param
.
to_sql
end
def
test_exec_no_binds
with_example_table
'id int, data string'
do
result
=
@conn
.
exec_query
(
'SELECT id, data FROM ex'
)
...
...
activerecord/test/cases/bind_parameter_test.rb
浏览文件 @
434ec237
...
...
@@ -39,7 +39,7 @@ def test_bind_from_join_in_subquery
end
def
test_binds_are_logged
sub
=
@connection
.
substitute_at
(
@pk
)
sub
=
Arel
::
Nodes
::
BindParam
.
new
binds
=
[
Relation
::
QueryAttribute
.
new
(
"id"
,
1
,
Type
::
Value
.
new
)]
sql
=
"select * from topics where id =
#{
sub
.
to_sql
}
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录