active_house 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_house/querying/from.rb +3 -3
- data/lib/active_house/querying/select.rb +4 -4
- data/lib/active_house/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: 50733d5482718e12146c8c79d9c4d372df311268
|
4
|
+
data.tar.gz: e3d33e478537b2a0a04e9f02dd970d4c823432c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c52e1158125f806bdd6f8547ba2cd64cc6b2426c9b5c1a3993fc00cf6802b890d3c8d490ccbb3968042778a4a6b1709ff95bb0f28d1572c07530dcb71d00bdc7
|
7
|
+
data.tar.gz: 77f1afc5c493e9ca5fd372763dedaf5036eb0bf22a59c10a5117c435b7abfdd45c04dc63fbb2029b6d0c7cea8210a51673b4bff3f9015e100a722e4e279ea46c
|
@@ -8,8 +8,8 @@ module ActiveHouse
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def from_subquery
|
11
|
-
return model_class._table_name if values[:
|
12
|
-
query = values[:
|
11
|
+
return model_class._table_name if values[:from].nil?
|
12
|
+
query = values[:from].is_a?(ActiveHouse::QueryBuilder) ? values[:from].to_query : values[:from].to_s
|
13
13
|
"( #{query} )"
|
14
14
|
end
|
15
15
|
|
@@ -18,7 +18,7 @@ module ActiveHouse
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def from!(table_or_subquery)
|
21
|
-
values[:
|
21
|
+
values[:from] = table_or_subquery.dup
|
22
22
|
self
|
23
23
|
end
|
24
24
|
|
@@ -10,15 +10,15 @@ module ActiveHouse
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def build_select_query_part
|
13
|
-
if !values[:
|
14
|
-
"SELECT\n#{values[:
|
13
|
+
if !values[:select].empty?
|
14
|
+
"SELECT\n#{values[:select].join(",\n")}"
|
15
15
|
else
|
16
16
|
'SELECT *'
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
def initial_values
|
21
|
-
super.merge
|
21
|
+
super.merge select: []
|
22
22
|
end
|
23
23
|
|
24
24
|
def select(*fields)
|
@@ -27,7 +27,7 @@ module ActiveHouse
|
|
27
27
|
|
28
28
|
def select!(*fields)
|
29
29
|
formatted_fields = ActiveHouse::PreparedStatement.format_fields(model_class, fields)
|
30
|
-
values[:
|
30
|
+
values[:select] = (values[:select] + formatted_fields).uniq
|
31
31
|
self
|
32
32
|
end
|
33
33
|
end
|
data/lib/active_house/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_house
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Talakevich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|