Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
4d31ee1e
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,发现更多精彩内容 >>
提交
4d31ee1e
编写于
11月 22, 2010
作者:
A
Aaron Patterson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
removing unused variables
上级
e83d1537
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
7 addition
and
12 deletion
+7
-12
activerecord/lib/active_record/associations/through_association_scope.rb
...b/active_record/associations/through_association_scope.rb
+2
-2
activerecord/test/cases/associations/has_many_associations_test.rb
...ord/test/cases/associations/has_many_associations_test.rb
+1
-2
activerecord/test/cases/associations/has_many_through_associations_test.rb
.../cases/associations/has_many_through_associations_test.rb
+0
-1
activerecord/test/cases/associations/has_one_associations_test.rb
...cord/test/cases/associations/has_one_associations_test.rb
+3
-4
activerecord/test/cases/associations/inverse_associations_test.rb
...cord/test/cases/associations/inverse_associations_test.rb
+0
-2
activerecord/test/cases/associations/join_model_test.rb
activerecord/test/cases/associations/join_model_test.rb
+1
-1
未找到文件。
activerecord/lib/active_record/associations/through_association_scope.rb
浏览文件 @
4d31ee1e
...
...
@@ -16,7 +16,7 @@ def construct_find_scope
:readonly
=>
@reflection
.
options
[
:readonly
]
}
end
def
construct_create_scope
construct_owner_attributes
(
@reflection
)
end
...
...
@@ -51,7 +51,7 @@ def construct_from
def
construct_select
(
custom_select
=
nil
)
distinct
=
"DISTINCT "
if
@reflection
.
options
[
:uniq
]
selected
=
custom_select
||
@reflection
.
options
[
:select
]
||
"
#{
distinct
}#{
@reflection
.
quoted_table_name
}
.*"
custom_select
||
@reflection
.
options
[
:select
]
||
"
#{
distinct
}#{
@reflection
.
quoted_table_name
}
.*"
end
def
construct_joins
(
custom_joins
=
nil
)
...
...
activerecord/test/cases/associations/has_many_associations_test.rb
浏览文件 @
4d31ee1e
...
...
@@ -67,8 +67,7 @@ def test_create_from_association_should_respect_default_scope
end
def
test_no_sql_should_be_fired_if_association_already_loaded
car
=
Car
.
create
(
:name
=>
'honda'
)
bulb
=
car
.
bulbs
.
create
Car
.
create
(
:name
=>
'honda'
)
bulbs
=
Car
.
first
.
bulbs
bulbs
.
inspect
# to load all instances of bulbs
assert_no_queries
do
...
...
activerecord/test/cases/associations/has_many_through_associations_test.rb
浏览文件 @
4d31ee1e
...
...
@@ -354,7 +354,6 @@ def test_association_proxy_transaction_method_starts_transaction_in_association_
end
def
test_has_many_association_through_a_belongs_to_association_where_the_association_doesnt_exist
author
=
authors
(
:mary
)
post
=
Post
.
create!
(
:title
=>
"TITLE"
,
:body
=>
"BODY"
)
assert_equal
[],
post
.
author_favorites
end
...
...
activerecord/test/cases/associations/has_one_associations_test.rb
浏览文件 @
4d31ee1e
...
...
@@ -163,7 +163,6 @@ def test_exclusive_dependence
firm
=
ExclusivelyDependentFirm
.
find
(
9
)
assert_not_nil
firm
.
account
account_id
=
firm
.
account
.
id
assert_equal
[],
Account
.
destroyed_account_ids
[
firm
.
id
]
firm
.
destroy
...
...
@@ -180,7 +179,7 @@ def test_dependence_with_nil_associate
def
test_dependence_with_restrict
firm
=
RestrictedFirm
.
new
(
:name
=>
'restrict'
)
firm
.
save!
account
=
firm
.
create_account
(
:credit_limit
=>
10
)
firm
.
create_account
(
:credit_limit
=>
10
)
assert_not_nil
firm
.
account
assert_raise
(
ActiveRecord
::
DeleteRestrictionError
)
{
firm
.
destroy
}
end
...
...
@@ -197,8 +196,8 @@ def test_successful_build_association
def
test_build_association_twice_without_saving_affects_nothing
count_of_account
=
Account
.
count
firm
=
Firm
.
find
(
:first
)
account1
=
firm
.
build_account
(
"credit_limit"
=>
1000
)
account2
=
firm
.
build_account
(
"credit_limit"
=>
2000
)
firm
.
build_account
(
"credit_limit"
=>
1000
)
firm
.
build_account
(
"credit_limit"
=>
2000
)
assert_equal
count_of_account
,
Account
.
count
end
...
...
activerecord/test/cases/associations/inverse_associations_test.rb
浏览文件 @
4d31ee1e
...
...
@@ -484,7 +484,6 @@ def test_eager_loaded_child_instance_should_be_shared_with_parent_on_find
def
test_child_instance_should_be_shared_with_replaced_via_accessor_parent
face
=
faces
(
:confused
)
old_man
=
face
.
polymorphic_man
new_man
=
Man
.
new
assert_not_nil
face
.
polymorphic_man
...
...
@@ -499,7 +498,6 @@ def test_child_instance_should_be_shared_with_replaced_via_accessor_parent
def
test_child_instance_should_be_shared_with_replaced_via_method_parent
face
=
faces
(
:confused
)
old_man
=
face
.
polymorphic_man
new_man
=
Man
.
new
assert_not_nil
face
.
polymorphic_man
...
...
activerecord/test/cases/associations/join_model_test.rb
浏览文件 @
4d31ee1e
...
...
@@ -642,7 +642,7 @@ def test_preload_polymorph_many_types
def
test_preload_nil_polymorphic_belongs_to
assert_nothing_raised
do
taggings
=
Tagging
.
find
(
:all
,
:include
=>
:taggable
,
:conditions
=>
[
'taggable_type IS NULL'
])
Tagging
.
find
(
:all
,
:include
=>
:taggable
,
:conditions
=>
[
'taggable_type IS NULL'
])
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录