提交 3d1bc89e 编写于 作者: A Akira Matsuda

remove meaningless use of Relation#all

particularly, `all(options)` would warn
上级 79255fab
......@@ -165,7 +165,7 @@ def clear_aggregation_cache #:nodoc:
# 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":
#
# Customer.where(balance: Money.new(20, "USD")).all
# Customer.where(balance: Money.new(20, "USD"))
#
module ClassMethods
# Adds reader and writer methods for manipulating a value object:
......
......@@ -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#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.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.delete(category1), Project#categories.destroy(category1)</tt>
#
......@@ -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
# 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:
# <tt>LEFT OUTER JOIN comments ON comments.post_id = posts.id</tt> and
......
......@@ -26,7 +26,7 @@ module Locking
#
# Account.transaction do
# # select * from accounts where ...
# accounts = Account.where(...).all
# accounts = Account.where(...)
# account1 = accounts.detect { |account| ... }
# account2 = accounts.detect { |account| ... }
# # select * from accounts where id=? for update
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册