active_record_query_fixer 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_query_fixer.rb +2 -1
- data/lib/active_record_query_fixer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd63505e1bd2832e3c0d25b29695a056ea45753244c9e0df443a921dbca9e95
|
4
|
+
data.tar.gz: 13393c3e1fffd4edfaedfcf720c2e4200e60761af8e9cd57471bc3d58965cba2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cde6df550b51fba75fd4a65837d7a949727698c76824cefa34a6dd4054c822afe852462ed0e63125734b8230ce979f6b53190b05bd5237c04d4b09d87d40282
|
7
|
+
data.tar.gz: 51aacd618be7155fa7d8bd94bf78c9cbbc0671822b373baf730e926f74acde591b3b787684c49e9e3a07392799f518b52900147f3795dea9319cf5630ac93728
|
@@ -62,6 +62,7 @@ class ActiveRecordQueryFixer
|
|
62
62
|
|
63
63
|
def fix_order_select_distinct
|
64
64
|
changed = false
|
65
|
+
select_defined = @query.values[:select].present?
|
65
66
|
|
66
67
|
sort_targets.each do |sort_target|
|
67
68
|
fields = sort_target.dig("SortBy", "node", "ColumnRef", "fields")
|
@@ -77,7 +78,7 @@ class ActiveRecordQueryFixer
|
|
77
78
|
@count_select += 1
|
78
79
|
end
|
79
80
|
|
80
|
-
@query = @query.select("#{@query.table_name}.*") if changed
|
81
|
+
@query = @query.select("#{@query.table_name}.*") if changed && !select_defined
|
81
82
|
|
82
83
|
self
|
83
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_query_fixer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dig_bang
|