piggly 2.1.0 → 2.2.0

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: f16c8c0dbea51654e23f87e09524076da758fb8e
4
- data.tar.gz: 99c21d733eb0fc50e1334e760f7601141eac4c3a
3
+ metadata.gz: 5c6bf40f9aa03c6a2ebf7dc77185b8d0fb17cb1b
4
+ data.tar.gz: 72e0c24978ea9924e1a1c83a4022fa3556a492ad
5
5
  SHA512:
6
- metadata.gz: 75479a4b5b69f804d2d7dd54272f65784301821a1088a3e969398610e8f4a56f114b48dca7606d34605305d4f440af669a9a7cfecf796a2c4aa59ad3fafff981
7
- data.tar.gz: fbff8e9856834ad14593596fd5ea76ddfaf49ee9c8625afbb4257450b0e04e1ca4699c9b24e76de20c78283d91204cc25d5666244e6900d498b228eb1f389956
6
+ metadata.gz: 3bfa8e89afcd5a97f4e5dca7f16b610ac47aa900b2053c2a3cd436131f3d0c49caf24c16f9ac9bb60d80c994fe6f80d536d80f710fd42c1d14b4fe08290aac4d
7
+ data.tar.gz: 924a46543d48d96cd15b4fdb0c02ff5bd24097d2a48e8ba0a099ac71c7241449f3e88649938ba9c571e9e47a1d3e1d9c24faf1a8580cacdb647541464b471279
@@ -42,14 +42,14 @@ module Piggly
42
42
 
43
43
  def quote
44
44
  if @schema
45
- '"' + @schema + '"."' + @name + '"' + @array
45
+ '"' + @schema + '"."' + normalize(@name) + '"' + @array
46
46
  else
47
- '"' + @name + '"' + @array
47
+ '"' + normalize(@name) + '"' + @array
48
48
  end
49
49
  end
50
50
 
51
51
  def to_s
52
- if @schema and !%w[public pg_catalog].include?(@schema)
52
+ unless [nil, "", "pg_catalog"].include?(@schema)
53
53
  @schema + "." + readable(@name) + @array
54
54
  else
55
55
  readable(@name) + @array
@@ -63,6 +63,10 @@ module Piggly
63
63
  protected
64
64
 
65
65
  def normalize(name)
66
+ unless [nil, "", "pg_catalog"].include?(@schema)
67
+ return name
68
+ end
69
+
66
70
  # select format_type(ret.oid, null), ret.typname
67
71
  # from pg_type as ret
68
72
  # where ret.typname <> format_type(ret.oid, null)
@@ -1,7 +1,7 @@
1
1
  module Piggly
2
2
  module VERSION
3
3
  MAJOR = 2
4
- MINOR = 1
4
+ MINOR = 2
5
5
  TINY = 0
6
6
 
7
7
  RELEASE_DATE = "2017-09-07"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piggly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kvle Putnam