couchbase-model-relationship 0.1.4 → 0.1.5

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.
@@ -57,7 +57,8 @@ module Couchbase
57
57
  end
58
58
 
59
59
  def clean!
60
- @changed_attributes.clear if changed?
60
+ @changed_attributes.try(:clear)
61
+ @previously_changed.try(:clear)
61
62
  end
62
63
 
63
64
  def previous_attribute(attr)
@@ -11,6 +11,10 @@ module Couchbase
11
11
  self.class.prefixed_id(id)
12
12
  end
13
13
 
14
+ def unprefixed_id
15
+ self.class.unprefixed_id(self.id)
16
+ end
17
+
14
18
  def create_with_id_prefix(options = {})
15
19
  ensure_has_id
16
20
  create_without_id_prefix(options)
@@ -1,7 +1,7 @@
1
1
  module Couchbase
2
2
  class Model
3
3
  module Relationship
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
7
7
  end
@@ -6,6 +6,12 @@ end
6
6
  describe "IdPrefix" do
7
7
  subject { IdPrefixTest.new }
8
8
 
9
+ it "unprefixes it's own id" do
10
+ subject.send(:ensure_has_id)
11
+
12
+ subject.unprefixed_id.should eq(subject.id.split(':').last)
13
+ end
14
+
9
15
  it "knows the proper prefix" do
10
16
  subject.class.id_prefix.should eq("id_prefix_test")
11
17
  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.4
4
+ version: 0.1.5
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-09-23 00:00:00.000000000 Z
12
+ date: 2013-10-24 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: 2428190520641562026
221
+ hash: 2276442051598353428
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: 2428190520641562026
230
+ hash: 2276442051598353428
231
231
  requirements: []
232
232
  rubyforge_project:
233
233
  rubygems_version: 1.8.24