torque-postgresql 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/torque/postgresql/auxiliary_statement.rb +4 -3
- data/lib/torque/postgresql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a258d6ecef85609644383dcb9b0664d7cd475943
|
4
|
+
data.tar.gz: 759dfc6d12e06182ab2dcd7200cf28369da93c8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b739abd40aa5039ac1869908a9dedf000487d03ec6741c192b4c48c47c892b58a9352c8f5f454bdf5c642e70cfb9c6dea5c76612c8c045cf8b3069dc76d9c4a5
|
7
|
+
data.tar.gz: 8069f73a279d069eb52bac167c95ad38e1da1b1a270d5fc28fe6c48a832307980bf509c39f2f12c749904cd689c4cf6b68b5e203a7b88b726c3c682e504f2c2b
|
@@ -3,6 +3,7 @@ require_relative 'auxiliary_statement/settings'
|
|
3
3
|
module Torque
|
4
4
|
module PostgreSQL
|
5
5
|
class AuxiliaryStatement
|
6
|
+
TABLE_COLUMN_AS_STRING = /\A(?:"?(\w+)"?\.)?"?(\w+)"?\z/.freeze
|
6
7
|
|
7
8
|
class << self
|
8
9
|
# These attributes require that the class is setup
|
@@ -82,9 +83,9 @@ module Torque
|
|
82
83
|
def project(column, arel_table = nil)
|
83
84
|
if column.respond_to?(:as)
|
84
85
|
return column
|
85
|
-
elsif column.to_s
|
86
|
-
|
87
|
-
arel_table = ::Arel::Table.new(
|
86
|
+
elsif (as_string = TABLE_COLUMN_AS_STRING.match(column.to_s))
|
87
|
+
column = as_string[2]
|
88
|
+
arel_table = ::Arel::Table.new(as_string[1]) unless as_string[1].nil?
|
88
89
|
end
|
89
90
|
|
90
91
|
arel_table ||= table
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torque-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|