aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/spawn_methods.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-09-09 15:16:45 -0300
committerEmilio Tagua <miloops@gmail.com>2010-09-09 15:16:45 -0300
commit33412b6e160fce8c6497d5f0a73dcc4366a0d428 (patch)
treeedf4c159445f4fcadf5a12dc063e6855f4b5cf4e /activerecord/lib/active_record/relation/spawn_methods.rb
parent632120deb4b31eda5863e3afe1a223f9237eec81 (diff)
downloadrails-33412b6e160fce8c6497d5f0a73dcc4366a0d428.tar.gz
rails-33412b6e160fce8c6497d5f0a73dcc4366a0d428.tar.bz2
rails-33412b6e160fce8c6497d5f0a73dcc4366a0d428.zip
No need to go through every option and test it, just don't add skipped ones.
Diffstat (limited to 'activerecord/lib/active_record/relation/spawn_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index a6cf59fbf1..d833832faf 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -64,12 +64,12 @@ module ActiveRecord
def except(*skips)
result = self.class.new(@klass, table)
- (Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS).each do |method|
- result.send(:"#{method}_values=", send(:"#{method}_values")) unless skips.include?(method)
+ ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) - skips).each do |method|
+ result.send(:"#{method}_values=", send(:"#{method}_values"))
end
- Relation::SINGLE_VALUE_METHODS.each do |method|
- result.send(:"#{method}_value=", send(:"#{method}_value")) unless skips.include?(method)
+ (Relation::SINGLE_VALUE_METHODS - skips).each do |method|
+ result.send(:"#{method}_value=", send(:"#{method}_value"))
end
result