directiverecord 0.1.31 → 0.1.32
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb7dc46ac479a9de38a158e0e98e6d0b1d01d187
|
4
|
+
data.tar.gz: ad4da8692eb11cbd14d1de27059bdda64cb77e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d206d14e6d042182e73b699b74fffb482e0141b87475a3aad4304b8c3b0c78404b9acfb7f408aed805e79ebb7d7e263bce01aa21056641a307a71ce3e18f87ad
|
7
|
+
data.tar.gz: 59392eda1abed8b78dee862ccbfec2a4ed8d50076a01a1ee7a75ad0488ad0e43ed825757c03d4a28389ad964144dc50ecb936f8ae08e989a76a80196c081c986
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= DirectiveRecord CHANGELOG
|
2
2
|
|
3
|
+
== Version 0.1.32 (October 23, 2015)
|
4
|
+
|
5
|
+
* Added #qry_value and #qry_values
|
6
|
+
* Improved detecting quotations (see http://stackoverflow.com/questions/171480/regex-grabbing-values-between-quotation-marks)
|
7
|
+
|
3
8
|
== Version 0.1.31 (August 26, 2015)
|
4
9
|
|
5
10
|
* Improved the :group_by, :having and :order_by option correction
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.32
|
@@ -9,6 +9,14 @@ module ActiveRecord
|
|
9
9
|
extract_connection(args).select_rows to_qry(*args)
|
10
10
|
end
|
11
11
|
|
12
|
+
def self.qry_value(*args)
|
13
|
+
extract_connection(args).select_value to_qry(*args)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.qry_values(*args)
|
17
|
+
extract_connection(args).select_values to_qry(*args)
|
18
|
+
end
|
19
|
+
|
12
20
|
def self.to_trend_qry(q1, q2, join_column_count, options)
|
13
21
|
DirectiveRecord::Query.new(self).to_trend_sql(q1, q2, join_column_count, options)
|
14
22
|
end
|
@@ -257,7 +257,7 @@ SQL
|
|
257
257
|
|
258
258
|
where, having = (options[:where] || []).partition do |statement|
|
259
259
|
!options[:aggregated].keys.include?(statement.strip.match(regexp).to_s) &&
|
260
|
-
statement.gsub(/(
|
260
|
+
statement.gsub(/(["'])(?:(?=(\\?))\2.)*?\1/, " ")
|
261
261
|
.split(/\b(and|or)\b/i).reject{|sql| %w(and or).include? sql.downcase}
|
262
262
|
.collect{|sql| sql = sql.strip; (sql[0] == "(" && sql[-1] == ")" ? sql[1..-1] : sql)}
|
263
263
|
.all? do |sql|
|
@@ -373,7 +373,7 @@ SQL
|
|
373
373
|
[:select, :where, :group_by, :having, :order_by].inject([]) do |paths, key|
|
374
374
|
if value = options[key]
|
375
375
|
value = value.join " " if value.is_a?(Array)
|
376
|
-
paths.concat value.gsub(/(
|
376
|
+
paths.concat value.gsub(/(["'])(?:(?=(\\?))\2.)*?\1/, " ").gsub(/sub:[a-zA-Z_]+\.[a-zA-Z_\.]+/, " ").scan(/[a-zA-Z_]+\.[a-zA-Z_\.]+/).collect{|x| x.split(".")[0..-2].join "."}
|
377
377
|
else
|
378
378
|
paths
|
379
379
|
end
|
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.32
|
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-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.4.
|
209
|
+
rubygems_version: 2.4.6
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: A layer on top of ActiveRecord for using paths within queries without thinking
|