couchbase-orm 0.0.4 → 0.0.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.
- checksums.yaml +4 -4
- data/lib/couchbase-orm/base.rb +8 -2
- data/lib/couchbase-orm/railtie.rb +3 -1
- data/lib/couchbase-orm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97d4d22e92253cd711eac00f3ef2be972e6a7edf
|
|
4
|
+
data.tar.gz: 54c9999852f93b4e3cdbc0902e2f5e1eb5d41410
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0697517128397f38ed0e449ffc284a7df7023c73d04eeebd25d03cfc50af43702950d258a9de536835439bfd3ecddb0b29083df0bb5a583669f1ada6e69b00da
|
|
7
|
+
data.tar.gz: ade8348fee4da31af06dcf5174dfe68b8b13619d5a490470add44e85c7d74983722223b8f076ab55cb03f2f9a76f7776c8fc910ebf31e6bb83df44e35a143fb5
|
data/lib/couchbase-orm/base.rb
CHANGED
|
@@ -150,11 +150,11 @@ module CouchbaseOrm
|
|
|
150
150
|
@__metadata__.cas = model.cas
|
|
151
151
|
|
|
152
152
|
# This ensures that defaults are applied
|
|
153
|
-
|
|
153
|
+
@__attributes__.merge! doc
|
|
154
154
|
when CouchbaseOrm::Base
|
|
155
155
|
attributes = model.attributes
|
|
156
156
|
attributes.delete(:id)
|
|
157
|
-
|
|
157
|
+
@__attributes__ = attributes
|
|
158
158
|
else
|
|
159
159
|
super(**attributes.merge(Hash(model)))
|
|
160
160
|
end
|
|
@@ -212,6 +212,12 @@ module CouchbaseOrm
|
|
|
212
212
|
end
|
|
213
213
|
end
|
|
214
214
|
|
|
215
|
+
ID_LOOKUP = ['id', :id].freeze
|
|
216
|
+
def read_attribute_for_serialization(attr)
|
|
217
|
+
return self.id if ID_LOOKUP.include?(attr)
|
|
218
|
+
@__attributes__[attr]
|
|
219
|
+
end
|
|
220
|
+
|
|
215
221
|
|
|
216
222
|
#
|
|
217
223
|
# Add support for comparisons
|
|
@@ -36,7 +36,9 @@ module Rails #:nodoc:
|
|
|
36
36
|
def self.rescue_responses
|
|
37
37
|
{
|
|
38
38
|
'Libcouchbase::Error::KeyNotFound' => :not_found,
|
|
39
|
-
'Libcouchbase::Error::NotStored' => :unprocessable_entity
|
|
39
|
+
'Libcouchbase::Error::NotStored' => :unprocessable_entity,
|
|
40
|
+
Libcouchbase::Error::KeyNotFound => :not_found,
|
|
41
|
+
Libcouchbase::Error::NotStored => :unprocessable_entity
|
|
40
42
|
}
|
|
41
43
|
end
|
|
42
44
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: couchbase-orm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen von Takach
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-11-
|
|
11
|
+
date: 2016-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: libcouchbase
|