couchbase-model-relationship 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,11 @@ module Couchbase
29
29
  end
30
30
 
31
31
  def next_prefixed_id
32
- prefixed_id(Couchbase::Model::UUID.generator.next(1, thread_storage[:uuid_algorithm]))
32
+ prefixed_id(next_unprefixed_id)
33
+ end
34
+
35
+ def next_unprefixed_id
36
+ Couchbase::Model::UUID.generator.next(1, thread_storage[:uuid_algorithm])
33
37
  end
34
38
 
35
39
  def prefixed_id(id)
@@ -37,16 +41,20 @@ module Couchbase
37
41
  end
38
42
 
39
43
  def unprefixed_id(id)
40
- id.to_s.split(':').last
44
+ id_parts(id).last
41
45
  end
42
46
 
43
47
  def prefix_from_id(id)
44
- id.to_s.split(':').first
48
+ id_parts(id).first
45
49
  end
46
50
 
47
51
  def class_from_id(id)
48
52
  prefix_from_id(id).classify.constantize
49
53
  end
54
+
55
+ def id_parts(id)
56
+ id.to_s.split(':')
57
+ end
50
58
  end
51
59
  end
52
60
  end
@@ -1,7 +1,7 @@
1
1
  module Couchbase
2
2
  class Model
3
3
  module Relationship
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase-model-relationship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
12
+ date: 2013-09-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -218,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  segments:
220
220
  - 0
221
- hash: -3592452870436957648
221
+ hash: 2428190520641562026
222
222
  required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  none: false
224
224
  requirements:
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  segments:
229
229
  - 0
230
- hash: -3592452870436957648
230
+ hash: 2428190520641562026
231
231
  requirements: []
232
232
  rubyforge_project:
233
233
  rubygems_version: 1.8.24