Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
3d1bc89e
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,发现更多精彩内容 >>
提交
3d1bc89e
编写于
1月 03, 2013
作者:
A
Akira Matsuda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove meaningless use of Relation#all
particularly, `all(options)` would warn
上级
79255fab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
4 deletion
+4
-4
activerecord/lib/active_record/aggregations.rb
activerecord/lib/active_record/aggregations.rb
+1
-1
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/associations.rb
+2
-2
activerecord/lib/active_record/locking/pessimistic.rb
activerecord/lib/active_record/locking/pessimistic.rb
+1
-1
未找到文件。
activerecord/lib/active_record/aggregations.rb
浏览文件 @
3d1bc89e
...
@@ -165,7 +165,7 @@ def clear_aggregation_cache #:nodoc:
...
@@ -165,7 +165,7 @@ def clear_aggregation_cache #:nodoc:
# by specifying an instance of the value object in the conditions hash. The following example
# by specifying an instance of the value object in the conditions hash. The following example
# finds all customers with +balance_amount+ equal to 20 and +balance_currency+ equal to "USD":
# finds all customers with +balance_amount+ equal to 20 and +balance_currency+ equal to "USD":
#
#
# Customer.where(balance: Money.new(20, "USD"))
.all
# Customer.where(balance: Money.new(20, "USD"))
#
#
module
ClassMethods
module
ClassMethods
# Adds reader and writer methods for manipulating a value object:
# Adds reader and writer methods for manipulating a value object:
...
...
activerecord/lib/active_record/associations.rb
浏览文件 @
3d1bc89e
...
@@ -194,7 +194,7 @@ def association_instance_set(name, association)
...
@@ -194,7 +194,7 @@ def association_instance_set(name, association)
# * <tt>Project#project_manager, Project#project_manager=(project_manager), Project#project_manager.nil?,</tt>
# * <tt>Project#project_manager, Project#project_manager=(project_manager), Project#project_manager.nil?,</tt>
# * <tt>Project#milestones.empty?, Project#milestones.size, Project#milestones, Project#milestones<<(milestone),</tt>
# * <tt>Project#milestones.empty?, Project#milestones.size, Project#milestones, Project#milestones<<(milestone),</tt>
# <tt>Project#milestones.delete(milestone), Project#milestones.destroy(mileston), Project#milestones.find(milestone_id),</tt>
# <tt>Project#milestones.delete(milestone), Project#milestones.destroy(mileston), Project#milestones.find(milestone_id),</tt>
# <tt>Project#milestones.
all(options), Project#milestones.
build, Project#milestones.create</tt>
# <tt>Project#milestones.build, Project#milestones.create</tt>
# * <tt>Project#categories.empty?, Project#categories.size, Project#categories, Project#categories<<(category1),</tt>
# * <tt>Project#categories.empty?, Project#categories.size, Project#categories, Project#categories<<(category1),</tt>
# <tt>Project#categories.delete(category1), Project#categories.destroy(category1)</tt>
# <tt>Project#categories.delete(category1), Project#categories.destroy(category1)</tt>
#
#
...
@@ -743,7 +743,7 @@ def association_instance_set(name, association)
...
@@ -743,7 +743,7 @@ def association_instance_set(name, association)
# other than the main one. If this is the case Active Record falls back to the previously
# other than the main one. If this is the case Active Record falls back to the previously
# used LEFT OUTER JOIN based strategy. For example
# used LEFT OUTER JOIN based strategy. For example
#
#
# Post.includes([:author, :comments]).where(['comments.approved = ?', true])
.all
# Post.includes([:author, :comments]).where(['comments.approved = ?', true])
#
#
# This will result in a single SQL query with joins along the lines of:
# This will result in a single SQL query with joins along the lines of:
# <tt>LEFT OUTER JOIN comments ON comments.post_id = posts.id</tt> and
# <tt>LEFT OUTER JOIN comments ON comments.post_id = posts.id</tt> and
...
...
activerecord/lib/active_record/locking/pessimistic.rb
浏览文件 @
3d1bc89e
...
@@ -26,7 +26,7 @@ module Locking
...
@@ -26,7 +26,7 @@ module Locking
#
#
# Account.transaction do
# Account.transaction do
# # select * from accounts where ...
# # select * from accounts where ...
# accounts = Account.where(...)
.all
# accounts = Account.where(...)
# account1 = accounts.detect { |account| ... }
# account1 = accounts.detect { |account| ... }
# account2 = accounts.detect { |account| ... }
# account2 = accounts.detect { |account| ... }
# # select * from accounts where id=? for update
# # select * from accounts where id=? for update
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录