elastictastic 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -32,16 +32,13 @@ module Elastictastic
|
|
32
32
|
def update(*ids, &block)
|
33
33
|
[].tap do |found|
|
34
34
|
case ids.length
|
35
|
-
when 0 then return
|
35
|
+
when 0 then return []
|
36
36
|
when 1
|
37
37
|
id = ids.first
|
38
38
|
instance = scoped({}).find_one(id, :preference => '_primary_first')
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
else
|
43
|
-
instances = []
|
44
|
-
end
|
39
|
+
return [] unless instance
|
40
|
+
found << id
|
41
|
+
instances = [instance]
|
45
42
|
else
|
46
43
|
instances = scoped({}).
|
47
44
|
find_many(ids, :preference => '_primary_first')
|