rasti-db 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rasti/db/collection.rb +2 -2
- data/lib/rasti/db/query.rb +4 -0
- data/lib/rasti/db/version.rb +1 -1
- data/spec/query_spec.rb +4 -0
- 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: 68eec068751c890730dc3399cd37d5903ba6ec82
|
4
|
+
data.tar.gz: 8fa04f6ffd482270decf4b329075f22b1effc068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beaf88832aa2d2077fc9c9ad61383bacebf84aeb21830cc965896d97fed3ad720482acd6cfd4a98a8369c58501702cdce5cc2d7865963660dad58c5cba531733
|
7
|
+
data.tar.gz: aa887838a3da061324e1f4d782f15a7fbf2ef5e327176ac7c92d7d51bec45269070cac3d24fe0a57d8d1b930569a0069a0ee036113a1f9addc4dfc56c8d59189
|
data/lib/rasti/db/collection.rb
CHANGED
@@ -2,7 +2,7 @@ module Rasti
|
|
2
2
|
module DB
|
3
3
|
class Collection
|
4
4
|
|
5
|
-
QUERY_METHODS = (Query::DATASET_CHAINED_METHODS + [:graph, :count, :all, :first]).freeze
|
5
|
+
QUERY_METHODS = (Query::DATASET_CHAINED_METHODS + [:graph, :count, :all, :first, :pluck, :primary_keys, :any?, :empty?, :raw]).freeze
|
6
6
|
|
7
7
|
include Helpers::WithSchema
|
8
8
|
|
@@ -177,7 +177,7 @@ module Rasti
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def exists?(filter=nil, &block)
|
180
|
-
build_query(filter, &block).
|
180
|
+
build_query(filter, &block).any?
|
181
181
|
end
|
182
182
|
|
183
183
|
def detect(filter=nil, &block)
|
data/lib/rasti/db/query.rb
CHANGED
data/lib/rasti/db/version.rb
CHANGED
data/spec/query_spec.rb
CHANGED
@@ -40,6 +40,10 @@ describe 'Query' do
|
|
40
40
|
users_query.map { |u| u.name }.must_equal db[:users].map(:name)
|
41
41
|
end
|
42
42
|
|
43
|
+
it 'Detect' do
|
44
|
+
users_query.detect(id: 3).must_equal User.new(id: 3, name: 'User 3')
|
45
|
+
end
|
46
|
+
|
43
47
|
it 'Where' do
|
44
48
|
users_query.where(id: 3).all.must_equal [User.new(id: 3, name: 'User 3')]
|
45
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasti-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|