Skip to content
This repository
Browse code

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

…d ones.
  • Loading branch information...
commit 33412b6e160fce8c6497d5f0a73dcc4366a0d428 1 parent 632120d
Emilio Tagua miloops authored
8 activerecord/lib/active_record/relation/spawn_methods.rb
@@ -64,12 +64,12 @@ def merge(r)
64 64 def except(*skips)
65 65 result = self.class.new(@klass, table)
66 66
67   - (Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS).each do |method|
68   - result.send(:"#{method}_values=", send(:"#{method}_values")) unless skips.include?(method)
  67 + ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) - skips).each do |method|
  68 + result.send(:"#{method}_values=", send(:"#{method}_values"))
69 69 end
70 70
71   - Relation::SINGLE_VALUE_METHODS.each do |method|
72   - result.send(:"#{method}_value=", send(:"#{method}_value")) unless skips.include?(method)
  71 + (Relation::SINGLE_VALUE_METHODS - skips).each do |method|
  72 + result.send(:"#{method}_value=", send(:"#{method}_value"))
73 73 end
74 74
75 75 result

0 comments on commit 33412b6

Please sign in to comment.
Something went wrong with that request. Please try again.