Permalink
Browse files

No need to go through every option and test it, just don't add skippe…

…d ones.
  • Loading branch information...
1 parent 733e928 commit 172377df45c38efe42f09d39cb19a3b82a508b01 @miloops miloops committed with tenderlove Sep 9, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 activerecord/lib/active_record/relation/spawn_methods.rb
@@ -64,12 +64,12 @@ def merge(r)
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

0 comments on commit 172377d

Please sign in to comment.