mm_uses_uuid 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/mm_uses_uuid.rb CHANGED
@@ -40,6 +40,7 @@ class UuidModel
40
40
 
41
41
  def self.find(*args)
42
42
  args.flatten!
43
+ single_id = args.length == 1 ? true : false
43
44
  ids_by_class = {}
44
45
  args.each do |id|
45
46
  lsn = id.to_s[-1].hex
@@ -48,7 +49,8 @@ class UuidModel
48
49
  ids_by_class[klass] ||= []
49
50
  ids_by_class[klass] << id
50
51
  end
51
- ids_by_class.map {|klass, ids| klass.find(ids)} .flatten
52
+ result = ids_by_class.map {|klass, ids| klass.find(ids)} .flatten
53
+ single_id ? result.first : result
52
54
  end
53
55
 
54
56
  end
@@ -1,3 +1,3 @@
1
1
  module MmUsesUuid
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 11
9
- version: 0.0.11
8
+ - 12
9
+ version: 0.0.12
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jonathan Chambers
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-03-03 00:00:00 +00:00
17
+ date: 2012-05-22 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency