directiverecord 0.1.29 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +6 -0
- data/VERSION +1 -1
- data/lib/directive_record/query/big_query.rb +1 -1
- data/lib/directive_record/query/mysql.rb +1 -1
- data/lib/directive_record/query/sql.rb +1 -1
- data/lib/directive_record/relation.rb +1 -1
- data/lib/directive_record/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: 8af004fe8d656116a9a968b0ceea0a5c558685cc
|
4
|
+
data.tar.gz: 3835a1b1137052e19f2994688fb48ab8412963ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72a42dd40f987a4467f51a2dfb79964fd4e2b90b7d2c38cfd36acf31ee48f0ed97a343ed950e41d95695c8a272803b7f425060f10c8ecb674ab9948985e88e80
|
7
|
+
data.tar.gz: eb544e7122a967db1e3929398070b8a0a85eca0bd4a5cc1e3a6ce207e47f1a879996e421ae063dcbe1f24a4d6dde2b1cd76d307b390a6766eabf4fc6bf05d19e
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
= DirectiveRecord CHANGELOG
|
2
2
|
|
3
|
+
== Version 0.1.30 (August 26, 2015)
|
4
|
+
|
5
|
+
* Made the :group_by, :having and :order_by option correction more strict
|
6
|
+
* Respecting optionally passed :where option when invoking #(to_)qry on a relation scope
|
7
|
+
* Improved distinguishing WHERE from HAVING statements
|
8
|
+
|
3
9
|
== Version 0.1.29 (August 17, 2015)
|
4
10
|
|
5
11
|
* Not normalizing select option again after having encountered new calculated columns in the GROUP BY statement, instead just register the alias
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.30
|
@@ -48,7 +48,7 @@ module DirectiveRecord
|
|
48
48
|
keys.each do |key|
|
49
49
|
if value = options[key]
|
50
50
|
value = value.join delimiter
|
51
|
-
aliases.each{|pattern, replacement| value.gsub! pattern
|
51
|
+
aliases.each{|pattern, replacement| value.gsub! /(?=\b|\s)#{Regexp.escape pattern}(?=\b|\s)/, replacement}
|
52
52
|
options[key] = value
|
53
53
|
end
|
54
54
|
end
|
@@ -24,7 +24,7 @@ module DirectiveRecord
|
|
24
24
|
[:group_by, :having, :order_by].each do |key|
|
25
25
|
if value = options[key]
|
26
26
|
value = value.join ", "
|
27
|
-
aliases.each{|pattern, replacement| value.gsub! pattern
|
27
|
+
aliases.each{|pattern, replacement| value.gsub! /(?=\b|\s)#{Regexp.escape pattern}(?=\b|\s)/, replacement}
|
28
28
|
options[key] = value
|
29
29
|
end
|
30
30
|
end
|
@@ -253,7 +253,7 @@ SQL
|
|
253
253
|
end
|
254
254
|
|
255
255
|
def normalize_where!(options)
|
256
|
-
regexp, aliases = /^\S+/, options[:aliases].
|
256
|
+
regexp, aliases = /^\S+/, options[:aliases].to_a.flatten.uniq.sort
|
257
257
|
|
258
258
|
where, having = (options[:where] || []).partition do |statement|
|
259
259
|
!options[:aggregated].keys.include?(statement.strip.match(regexp).to_s) &&
|
@@ -13,7 +13,7 @@ module DirectiveRecord
|
|
13
13
|
options.merge(
|
14
14
|
{
|
15
15
|
:select => (select.blank? ? ".*" : select),
|
16
|
-
:where => where_values.collect{|x| sql_aliases_to_paths(x)},
|
16
|
+
:where => where_values.collect{|x| sql_aliases_to_paths(x)} + [options[:where]].flatten.compact,
|
17
17
|
:group_by => group_values.collect{|x| sql_aliases_to_paths(x)},
|
18
18
|
:order_by => order_values.collect{|x| sql_aliases_to_paths(x)},
|
19
19
|
:limit => limit_value,
|
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.
|
4
|
+
version: 0.1.30
|
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-08-
|
11
|
+
date: 2015-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|