From 3d1bc89ec8e6558bac81c4e9fce82b586f742629 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 3 Jan 2013 23:38:31 +0900 Subject: [PATCH] remove meaningless use of Relation#all particularly, `all(options)` would warn --- activerecord/lib/active_record/aggregations.rb | 2 +- activerecord/lib/active_record/associations.rb | 4 ++-- activerecord/lib/active_record/locking/pessimistic.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 8101f7a45e..43d779da6e 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -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: diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 2c66882424..a12b38b08d 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -194,7 +194,7 @@ def association_instance_set(name, association) # * Project#project_manager, Project#project_manager=(project_manager), Project#project_manager.nil?, # * Project#milestones.empty?, Project#milestones.size, Project#milestones, Project#milestones<<(milestone), # Project#milestones.delete(milestone), Project#milestones.destroy(mileston), Project#milestones.find(milestone_id), - # Project#milestones.all(options), Project#milestones.build, Project#milestones.create + # Project#milestones.build, Project#milestones.create # * Project#categories.empty?, Project#categories.size, Project#categories, Project#categories<<(category1), # Project#categories.delete(category1), Project#categories.destroy(category1) # @@ -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: # LEFT OUTER JOIN comments ON comments.post_id = posts.id and diff --git a/activerecord/lib/active_record/locking/pessimistic.rb b/activerecord/lib/active_record/locking/pessimistic.rb index b4bb95a392..8e4ddcac82 100644 --- a/activerecord/lib/active_record/locking/pessimistic.rb +++ b/activerecord/lib/active_record/locking/pessimistic.rb @@ -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 -- GitLab