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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8931d215201a846318a6ba1c18570047c1527bd
4
- data.tar.gz: a9aa723946d7ab816b55e878d1162a04c6b4b8c6
3
+ metadata.gz: 7a81c222d851f359c7dd197ea67fb7bbafbc8e41
4
+ data.tar.gz: aa14655b6fdb71439014c89ef35f867437cdd134
5
5
  SHA512:
6
- metadata.gz: 628a886a5c6031249158082d564b99c30670876ef9685808ddb0d61fd69c2052b9de72283d5184e25139c84400c39f195af8aa1541e880c7b7a24dea6e7420e0
7
- data.tar.gz: e5802e47470b88a6359fc0e900dd557d7441b02b97675aced97e2028b0fc4269dd0f62d342288bfddec2ca830d1835fcbcd4bddba6438ffbb3ab0688a0f82701
6
+ metadata.gz: 2136694f5f169161dcb367d99f2e9a79605242c8f0bea7ec034627472197e0318c31f588976060f18c6402def8b6fe1ce51c8b366ee28af839bbe05871f75441
7
+ data.tar.gz: cf454470538e792a6757ea81a98d23de3940c7b00ab8c446204a65841e2ebb3af3c713d7fa795372e205b1feefc76a584aba97a67a1d2ce4441199a297ba129f
@@ -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
@@ -1,3 +1,3 @@
1
1
  class PGAdaptor
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_adaptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Rowe