Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove duplication of modifier checking.

My goodness I hate that merge method. It must die...
  • Loading branch information...
commit 3a35c38479c577a4aa936dbe25990c58f1fd35e7 1 parent 24a6b56
@jnunemaker jnunemaker authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/plucky/criteria_hash.rb
View
4 lib/plucky/criteria_hash.rb
@@ -76,13 +76,13 @@ def merge(other)
end
end
elsif value_is_hash && !other_is_hash
- if modifier_key = value.keys.detect { |k| k.to_s[0, 1] == '$' }
+ if modifier_key = value.keys.detect { |k| Plucky.modifier?(k) }
value[modifier_key].concat(Array(other_value)).uniq!
else
# kaboom! Array(value).concat(Array(other_value)).uniq
end
elsif other_is_hash && !value_is_hash
- if modifier_key = other_value.keys.detect { |k| k.to_s[0, 1] == '$' }
+ if modifier_key = other_value.keys.detect { |k| Plucky.modifier?(k) }
other_value[modifier_key].concat(Array(value)).uniq!
else
# kaboom! Array(value).concat(Array(other_value)).uniq
Please sign in to comment.
Something went wrong with that request. Please try again.