aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-13 10:43:12 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-13 13:17:42 +0100
commite4f0fbd994ab0c333e615be68a8d40593c7058e3 (patch)
tree09a50548e6f2d65310361a662f7ebb0c1953cff2 /activerecord/lib/active_record
parenta258c27653c6a57b62b30d34791b8bb671248150 (diff)
downloadrails-e4f0fbd994ab0c333e615be68a8d40593c7058e3.tar.gz
rails-e4f0fbd994ab0c333e615be68a8d40593c7058e3.tar.bz2
rails-e4f0fbd994ab0c333e615be68a8d40593c7058e3.zip
we have no need for the ASSOCIATION_METHODS constant
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation.rb11
-rw-r--r--activerecord/lib/active_record/relation/merger.rb2
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb4
3 files changed, 10 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index b007b8c168..0d7da67c98 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -6,9 +6,12 @@ module ActiveRecord
# = Active Record Relation
class Relation
JoinOperation = Struct.new(:relation, :join_class, :on)
- ASSOCIATION_METHODS = [:includes, :eager_load, :preload]
- MULTI_VALUE_METHODS = [:select, :group, :order, :joins, :where, :having, :bind, :references]
- SINGLE_VALUE_METHODS = [:limit, :offset, :lock, :readonly, :from, :reordering, :reverse_order, :uniq]
+
+ MULTI_VALUE_METHODS = [:includes, :eager_load, :preload, :select, :group,
+ :order, :joins, :where, :having, :bind, :references]
+
+ SINGLE_VALUE_METHODS = [:limit, :offset, :lock, :readonly, :from, :reordering,
+ :reverse_order, :uniq]
include FinderMethods, Calculations, SpawnMethods, QueryMethods, Batches, Explain, Delegation
@@ -25,7 +28,7 @@ module ActiveRecord
@default_scoped = false
SINGLE_VALUE_METHODS.each {|v| instance_variable_set(:"@#{v}_value", nil)}
- (ASSOCIATION_METHODS + MULTI_VALUE_METHODS).each {|v| instance_variable_set(:"@#{v}_values", [])}
+ MULTI_VALUE_METHODS.each {|v| instance_variable_set(:"@#{v}_values", [])}
@extensions = []
@create_with_value = {}
end
diff --git a/activerecord/lib/active_record/relation/merger.rb b/activerecord/lib/active_record/relation/merger.rb
index 3541645e1d..86e7f3ae0f 100644
--- a/activerecord/lib/active_record/relation/merger.rb
+++ b/activerecord/lib/active_record/relation/merger.rb
@@ -23,7 +23,7 @@ module ActiveRecord
private
def merge_multi_values
- values = Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS - [:where, :order, :bind]
+ values = Relation::MULTI_VALUE_METHODS - [:where, :order, :bind]
values.each do |method|
value = other.send(:"#{method}_values")
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index cdea847fb8..80c129d361 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -26,7 +26,7 @@ module ActiveRecord
result = self.class.new(@klass, table)
result.default_scoped = default_scoped
- ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) - skips).each do |method|
+ (Relation::MULTI_VALUE_METHODS - skips).each do |method|
result.send(:"#{method}_values=", send(:"#{method}_values"))
end
@@ -51,7 +51,7 @@ module ActiveRecord
result = self.class.new(@klass, table)
result.default_scoped = default_scoped
- ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) & onlies).each do |method|
+ (Relation::MULTI_VALUE_METHODS & onlies).each do |method|
result.send(:"#{method}_values=", send(:"#{method}_values"))
end