pg_adaptor 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pg_adaptor.rb +7 -2
- data/lib/pg_adaptor/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: 7a81c222d851f359c7dd197ea67fb7bbafbc8e41
|
4
|
+
data.tar.gz: aa14655b6fdb71439014c89ef35f867437cdd134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2136694f5f169161dcb367d99f2e9a79605242c8f0bea7ec034627472197e0318c31f588976060f18c6402def8b6fe1ce51c8b366ee28af839bbe05871f75441
|
7
|
+
data.tar.gz: cf454470538e792a6757ea81a98d23de3940c7b00ab8c446204a65841e2ebb3af3c713d7fa795372e205b1feefc76a584aba97a67a1d2ce4441199a297ba129f
|
data/lib/pg_adaptor.rb
CHANGED
@@ -27,7 +27,7 @@ class PGAdaptor
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def fetch selector = {}, *args
|
30
|
-
build @table.where(selector, *args).first
|
30
|
+
build @table.select(*fields).where(selector, *args).first
|
31
31
|
end
|
32
32
|
|
33
33
|
def remove selector = {}
|
@@ -35,7 +35,7 @@ class PGAdaptor
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def find selector = {}, *args
|
38
|
-
@table.where(selector, *args).map { |row| build row }
|
38
|
+
@table.select(*fields).where(selector, *args).map { |row| build row }
|
39
39
|
end
|
40
40
|
|
41
41
|
private
|
@@ -49,6 +49,11 @@ private
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
def fields
|
53
|
+
return Sequel.lit('*') if @klass.nil?
|
54
|
+
@klass.members.map(&:to_sym)
|
55
|
+
end
|
56
|
+
|
52
57
|
def schema
|
53
58
|
@schema ||=
|
54
59
|
begin
|
data/lib/pg_adaptor/version.rb
CHANGED