rasti-db 0.2.2 → 0.2.3
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/helpers.rb +1 -1
- data/lib/rasti/db/query.rb +1 -1
- data/lib/rasti/db/relations.rb +2 -2
- data/lib/rasti/db/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3346ca61759323bb5a2cfe167638edf9fc9b36b
|
4
|
+
data.tar.gz: 816e89c418e13e06208bc34c4a62da38cb46fa18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d18d2aaf1f84c78f14ee37aecb65c9f5d08c4b1484989cf1b0125f9440bf6afe612cc80e135fd01e5986ac23f325ec361021adb8123b660d62a86dccfb8ae0
|
7
|
+
data.tar.gz: 7e38fc6ee6cb1dd9348a002c4ba13c02a6007331fb741f5c3be04f2dfb8300d6a8c8d531f59dee24d0f7de13ad60e1af0adb669da4807fedc2f5da5576779097
|
data/lib/rasti/db/collection.rb
CHANGED
@@ -84,7 +84,7 @@ module Rasti
|
|
84
84
|
|
85
85
|
def initialize(db, schema=nil)
|
86
86
|
@db = db
|
87
|
-
@schema = schema
|
87
|
+
@schema = schema
|
88
88
|
end
|
89
89
|
|
90
90
|
def dataset
|
@@ -191,7 +191,7 @@ module Rasti
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def qualified_collection_name
|
194
|
-
schema.nil? ? self.class.collection_name : Sequel
|
194
|
+
schema.nil? ? self.class.collection_name : Sequel.qualify(schema, self.class.collection_name)
|
195
195
|
end
|
196
196
|
|
197
197
|
def build_query(filter=nil, &block)
|
data/lib/rasti/db/helpers.rb
CHANGED
data/lib/rasti/db/query.rb
CHANGED
@@ -19,7 +19,7 @@ module Rasti
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def pluck(*attributes)
|
22
|
-
ds = dataset.select(*attributes.map { |attr| Sequel
|
22
|
+
ds = dataset.select(*attributes.map { |attr| Sequel.qualify(collection_class.collection_name, attr) })
|
23
23
|
attributes.count == 1 ? ds.map { |r| r[attributes.first] } : ds.map(&:values)
|
24
24
|
end
|
25
25
|
|
data/lib/rasti/db/relations.rb
CHANGED
@@ -125,7 +125,7 @@ module Rasti
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def qualified_relation_collection_name(schema=nil)
|
128
|
-
schema.nil? ? relation_collection_name : Sequel
|
128
|
+
schema.nil? ? relation_collection_name : Sequel.qualify(schema, relation_collection_name)
|
129
129
|
end
|
130
130
|
|
131
131
|
def graph_to(rows, db, schema=nil, relations=[])
|
@@ -137,7 +137,7 @@ module Rasti
|
|
137
137
|
|
138
138
|
join_rows = target_collection.dataset
|
139
139
|
.join(relation_name, target_foreign_key => target_collection_class.primary_key)
|
140
|
-
.where(Sequel
|
140
|
+
.where(Sequel.qualify(relation_name, source_foreign_key) => pks)
|
141
141
|
.all
|
142
142
|
|
143
143
|
Relations.graph_to join_rows, relations, target_collection_class, db, schema
|
data/lib/rasti/db/version.rb
CHANGED