directiverecord 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODFhYjVlZWJhYWQxOTQyZDRjZDgwNmI0ODhjOGM1NzMwMGJmM2I5Zg==
4
+ NGU4Njg2NzU3OTk2NzUyYzlkYWVhMTQ3OTYwODQ1YWVjNmMyNjRiZQ==
5
5
  data.tar.gz: !binary |-
6
- MGFhNzc2NWRhOWQ0MGQwM2RjZDVlNWNhYmJhNjY1MGI1MTdlYzgyOA==
6
+ NWE2MjQ5NThkZTZhMmJlZmZiODZiMzdkMGZlNjk4YWIzODcyMzBhZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGU1MTQ0NTZiNmY1MjBiMmJhN2Y2ZGQ4ZTBiNGQwN2ZkNjFjYzAzN2FhYWM1
10
- Nzk4NjllY2ZiZjczMTA1OWM2NmYwM2YwYWY3MTY2ZDVkZDgwMGJkNjQ5YzEx
11
- OGQ4MzcxNjllNjRiMDA3ZWJlYmU2MmIyYWViM2M5MDQ1MDc5NGY=
9
+ N2ZlOGE0Yjc2NDU4YzViOWZmZGRlMzAxOWM1YTY0OWQ4MmU3MjFiODQ4MTlm
10
+ N2RlYjFhNWE4NzZhYjNlODMxYmFkYTQ5NmQyNDJjMjlkNzE3NmMyZmQ0Njc3
11
+ YjAxYzhlNTUyY2UwOTQ0NmE3MGNiMTk1ZTI2ODg1ZWI2ZjRhMjQ=
12
12
  data.tar.gz: !binary |-
13
- YTBjOGM1ODRmYTk4MTI0YmJkY2YwYjljOTUwNDJkMDEzYzg5MmFiMTcwMDA3
14
- NDU1ZDg3YTBjNWU4MjM0NjJlYzA5OThkNjJjMjFkMjg1OGExMjA5MWM5Yzk3
15
- M2JjMDA0ZmM1NDc2OWE0OWMzMGZhMTE4YTcwZTg4MDhkYmMyN2I=
13
+ MDdkZWVmZDExZmMwMzY1ZTRkZjdmODI2OWIwY2M4NTc4OTMwZTk1MWZmNmUz
14
+ ZGZkYjQwNjY3Zjk0ZTQ1NjU0MDExYWU5MzI0Y2E1N2I4NDdhYjk1NTJiYjQ2
15
+ YTM2YTAzNjFmMzQ2Yzc4NmIzODcwZDllZDg0OWM1ODc5NjhlZDc=
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = DirectiveRecord CHANGELOG
2
2
 
3
+ == Version 0.1.8 (February 25, 2015)
4
+
5
+ * Corrected auto-applying MAX(..) aggregate function within BigQuery SELECT statements
6
+
3
7
  == Version 0.1.7 (February 20, 2015)
4
8
 
5
9
  * Improved BigQuery FROM statement (using TABLE_DATE_RANGE)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -19,7 +19,7 @@ module DirectiveRecord
19
19
  end
20
20
  if begin_date
21
21
  dataset = ::BigQuery.connection.instance_variable_get(:@dataset) # TODO: fix this
22
- options[:from] = "\n (TABLE_DATE_RANGE(#{dataset}.#{base.table_name}_, TIMESTAMP('#{begin_date}'), TIMESTAMP('#{end_date}')))"
22
+ options[:from] = "\n TABLE_DATE_RANGE(#{dataset}.#{base.table_name}_, TIMESTAMP('#{begin_date}'), TIMESTAMP('#{end_date}'))"
23
23
  end
24
24
  end
25
25
  end
@@ -38,7 +38,7 @@ module DirectiveRecord
38
38
  select_expression ||= string
39
39
  group_by_expression = select_alias || string
40
40
 
41
- if options[:group_by].include?(group_by_expression) || !select_expression.match(/^\w+(\.\w+)*$/)
41
+ if options[:group_by].include?(group_by_expression) || options[:group_by].include?(select_expression) || !select_expression.match(/^\w+(\.\w+)*$/)
42
42
  string
43
43
  else
44
44
  ["MAX(#{select_expression})", select_alias].compact.join(" AS ")
@@ -1,7 +1,7 @@
1
1
  module DirectiveRecord
2
2
  MAJOR = 0
3
3
  MINOR = 1
4
- TINY = 7
4
+ TINY = 8
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
@@ -23,7 +23,7 @@ module Unit
23
23
  SUM(order_details_price_each) AS sum__order_details_price_each,
24
24
  SUM(order_details_quantity_ordered * order_details_price_each) AS price
25
25
  FROM
26
- (TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-21'), TIMESTAMP('2015-01-21')))
26
+ TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-21'), TIMESTAMP('2015-01-21'))
27
27
  GROUP BY id
28
28
  ORDER BY price DESC
29
29
  }.strip.gsub(/\s+/, " "),
@@ -45,7 +45,7 @@ module Unit
45
45
  %Q{
46
46
  SELECT id, SUM(order_details_quantity_ordered * order_details_price_each)
47
47
  FROM
48
- (TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21')))
48
+ TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21'))
49
49
  GROUP BY id
50
50
  ORDER BY id
51
51
  }.strip.gsub(/\s+/, " "),
@@ -63,7 +63,7 @@ module Unit
63
63
  %Q{
64
64
  SELECT id, MAX(customer_id), SUM(order_details_quantity_ordered * order_details_price_each)
65
65
  FROM
66
- (TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21')))
66
+ TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21'))
67
67
  GROUP BY id
68
68
  ORDER BY id
69
69
  }.strip.gsub(/\s+/, " "),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: directiverecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Engel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord