couchbase-model-relationship 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,7 @@ module Couchbase
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
remove_method :write_attribute
|
10
|
+
remove_method :reload
|
10
11
|
|
11
12
|
alias_method_chain :save, :dirty
|
12
13
|
alias_method_chain :create, :dirty
|
@@ -33,6 +34,16 @@ module Couchbase
|
|
33
34
|
@_attributes[name] = value
|
34
35
|
end
|
35
36
|
|
37
|
+
# This is until my change http://review.couchbase.org/#/c/29745/ is in
|
38
|
+
# and released.
|
39
|
+
def reload
|
40
|
+
raise Couchbase::Error::MissingId, 'missing id attribute' unless @id
|
41
|
+
pristine = model.find(@id)
|
42
|
+
update_attributes(pristine.attributes)
|
43
|
+
@meta[:cas] = pristine.meta[:cas]
|
44
|
+
self
|
45
|
+
end
|
46
|
+
|
36
47
|
def save_with_dirty(options = {})
|
37
48
|
save_without_dirty(options).tap do |value|
|
38
49
|
capture_previous_changes if value
|
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
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -218,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
segments:
|
220
220
|
- 0
|
221
|
-
hash:
|
221
|
+
hash: 4181024762891578791
|
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:
|
230
|
+
hash: 4181024762891578791
|
231
231
|
requirements: []
|
232
232
|
rubyforge_project:
|
233
233
|
rubygems_version: 1.8.24
|