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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1ce9f4613cd0dcd9620da942c301d828f2c29fe
4
- data.tar.gz: 813e819830b425a3483d6d859c96d35293576f10
3
+ metadata.gz: 50733d5482718e12146c8c79d9c4d372df311268
4
+ data.tar.gz: e3d33e478537b2a0a04e9f02dd970d4c823432c4
5
5
  SHA512:
6
- metadata.gz: e0ed42cf6fbb9f1f002fe0f7187e224bc20ad595dede752be19b563566e2afe259e3a4424fc9c8b5421e0af87b0bd1a1478987e3b98fd56ea580c67acfd74520
7
- data.tar.gz: 8947212b75c06e47f4e3e0cdf6d602dff157b6885bc4ead3f8e7e4fc7a74e84e2c77e4608ad544d2467fe8f57473924201411f444cc132944439de1b928deaab
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[:subquery].nil?
12
- query = values[:subquery].is_a?(ActiveHouse::QueryBuilder) ? values[:subquery].to_query : values[:subquery].to_s
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[:subquery] = table_or_subquery.dup
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[:fields].empty?
14
- "SELECT\n#{values[:fields].join(",\n")}"
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 fields: []
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[:fields] = (values[:fields] + formatted_fields).uniq
30
+ values[:select] = (values[:select] + formatted_fields).uniq
31
31
  self
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveHouse
2
- VERSION = '0.6.3'.freeze
2
+ VERSION = '0.6.4'.freeze
3
3
  end
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.3
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-06 00:00:00.000000000 Z
11
+ date: 2019-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel