pg_conn 0.27.0 → 0.27.1

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
  SHA256:
3
- metadata.gz: 735772bb654f60ebbd736fb3cd13cb9af8dfe00a3b796d5447457adea435dddd
4
- data.tar.gz: 6ee452ddb1a6e49d46b735b27d8a2f106959637d4e4373bf33d5ec72db757b9f
3
+ metadata.gz: 01735ada71fba436bf8387651722d380b68bfa9c028666946d343e22f94fb1ea
4
+ data.tar.gz: de757bfe82276b1641c693f93afcc630bcdea37d1bb33d65888652fdce6f3656
5
5
  SHA512:
6
- metadata.gz: 4bf460966a99794fc05a134638acca681da79700ec1be145fcde276bcad2070c1a743fcf8ee8fde6c7d65a07d21026ef96b2cedb24e54b8fa61aa80ce59694ca
7
- data.tar.gz: fa3e00167e8323f410def0d42c0e568f0185c90939e3891033a6a7e55dcdd5a0b0f50a5343f95c5f3ca2b0bba22312fd65fef25bc323f26956dfca3b9f45844a
6
+ metadata.gz: d15f076992d6bf1eaa05b5ba8b7f3a3cc7ca4150543449717ecf1a94f16d08d71602e55384dedb13fba4ab06465a8dc1ae1e109ef698cf848d0264243d49e1c5
7
+ data.tar.gz: 69b9a3cbd175d20e4b806a18124a008eff5ef33bdcfd4d3b482d50cbba20ce95f9684a407b1122cd7dee2464b96496b2803d22c93b2c6190ba52332248a8de4d
@@ -1,3 +1,3 @@
1
1
  module PgConn
2
- VERSION = "0.27.0"
2
+ VERSION = "0.27.1"
3
3
  end
data/lib/pg_conn.rb CHANGED
@@ -983,7 +983,10 @@ module PgConn
983
983
 
984
984
  # :call-seq
985
985
  # parse_query(query)
986
- # parse_query(table, id_or_where_clause = "true", fields = [])
986
+ # parse_query(table, id, fields...)
987
+ # parse_query(table, where_clause, fields...)
988
+ # parse_query(table, hash, fields...)
989
+ # parse_query(table, fields...)
987
990
  #
988
991
  # Parse a query. Used in query-functions (#value etc.). The fields argument
989
992
  # can be a list of fields or arrays of fields
@@ -998,6 +1001,10 @@ module PgConn
998
1001
  case args.first
999
1002
  when Integer; where_clause = "id = #{args.shift}"
1000
1003
  when String; where_clause = args.shift
1004
+ when Hash
1005
+ where_clause = args.shift.map { |k,v|
1006
+ "#{self.quote_identifier(k)} = #{self.quote_value(v) }"
1007
+ }.join(" and ")
1001
1008
  when Symbol; fields << args.shift
1002
1009
  when Array; fields = args.shift
1003
1010
  when nil; where_clause = "true"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_conn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen