couchbase-orm 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/couchbase-orm.rb +1 -1
- data/lib/couchbase-orm/base.rb +15 -5
- 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: 6b68fe44cc7da799f2e87e010a86bbdc8110afae
|
4
|
+
data.tar.gz: 2261e2cbe3d2d7daac611f9aa167ffdad4683495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52dd91e8aea71e0d3048486b4de9a7fa48ad6a5fe55e5e141c5037beb0b71764fab67ba22f6706372cf61b7a4a8c2d0dd3054a39d4d1c76c51a4b83f7bacea2d
|
7
|
+
data.tar.gz: dfaf5da9c871352fb05a75e3c670ca82f735641ffe0945943e609a519694c10881e7b62c2de04a62ff5202a918405f66bc08c20d89d1d4187a6f601067606416
|
data/lib/couchbase-orm.rb
CHANGED
data/lib/couchbase-orm/base.rb
CHANGED
@@ -92,7 +92,12 @@ module CouchbaseOrm
|
|
92
92
|
options[:extended] = true
|
93
93
|
options[:quiet] ||= false
|
94
94
|
|
95
|
-
ids = ids.flatten
|
95
|
+
ids = ids.flatten.select { |id| id.present? }
|
96
|
+
if ids.empty?
|
97
|
+
return nil if options[:quiet]
|
98
|
+
raise Libcouchbase::Error::EmptyKey, 'no id(s) provided'
|
99
|
+
end
|
100
|
+
|
96
101
|
records = bucket.get(*ids, **options)
|
97
102
|
|
98
103
|
records = records.is_a?(Array) ? records : [records]
|
@@ -109,7 +114,7 @@ module CouchbaseOrm
|
|
109
114
|
|
110
115
|
def find_by_id(*ids, **options)
|
111
116
|
options[:quiet] = true
|
112
|
-
find
|
117
|
+
find(*ids, **options)
|
113
118
|
end
|
114
119
|
alias_method :[], :find_by_id
|
115
120
|
|
@@ -213,9 +218,14 @@ module CouchbaseOrm
|
|
213
218
|
end
|
214
219
|
|
215
220
|
ID_LOOKUP = ['id', :id].freeze
|
216
|
-
def
|
217
|
-
return self.id if ID_LOOKUP.include?(
|
218
|
-
@__attributes__[
|
221
|
+
def attribute(name)
|
222
|
+
return self.id if ID_LOOKUP.include?(name)
|
223
|
+
@__attributes__[name]
|
224
|
+
end
|
225
|
+
alias_method :read_attribute_for_serialization, :attribute
|
226
|
+
|
227
|
+
def attribute=(name, value)
|
228
|
+
__send__(:"#{name}=", value)
|
219
229
|
end
|
220
230
|
|
221
231
|
|
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.6
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libcouchbase
|