mm_uses_uuid 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mm_uses_uuid.rb +2 -1
- data/lib/mm_uses_uuid/version.rb +1 -1
- metadata +1 -1
data/lib/mm_uses_uuid.rb
CHANGED
@@ -52,7 +52,7 @@ class UuidModel
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.find(*ids)
|
55
|
-
ids.flatten!
|
55
|
+
ids.flatten!.uniq!
|
56
56
|
ids_by_class = ids.each_with_object(Hash.new { |hash, key| hash[key] = [] }) do |id, hsh|
|
57
57
|
lsn = id.to_s[-1].hex
|
58
58
|
klass = @@lsn_class_lookup[lsn]
|
@@ -66,6 +66,7 @@ class UuidModel
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def self.find!(*ids)
|
69
|
+
ids.flatten!.uniq!
|
69
70
|
raise MongoMapper::DocumentNotFound, "Couldn't find without an ID" if ids.size == 0
|
70
71
|
find(*ids).tap do |result|
|
71
72
|
if result.nil? || ids.size != Array(result).size
|
data/lib/mm_uses_uuid/version.rb
CHANGED