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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fc75b0466693604d010e4489ac07fd724b21d3f5199b6379b92c3733c342cb4
4
- data.tar.gz: bf0a66c2fb45fdcb762058c3749d13fe6273f0eba822462c4c112f7fece00b71
3
+ metadata.gz: ecd63505e1bd2832e3c0d25b29695a056ea45753244c9e0df443a921dbca9e95
4
+ data.tar.gz: 13393c3e1fffd4edfaedfcf720c2e4200e60761af8e9cd57471bc3d58965cba2
5
5
  SHA512:
6
- metadata.gz: 00f4f4cbaf9d3e81e82c27e1a78a43867b8f511b29d398ff84624d462b7fef370a51b8e15d46e8462791222feb46e7d9a51718cafbec275aecb9a9da224e7c89
7
- data.tar.gz: 92b877b63ae9e03d15d79ff9611091935aa94983fb7676b8d34a478919c67fc64e108e8f7615662dea586a16b49c2c1569a1880fdac72784b3917c2cc800b267
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
@@ -1,3 +1,3 @@
1
1
  class ActiveRecordQueryFixer
2
- VERSION = "0.0.10".freeze
2
+ VERSION = "0.0.11".freeze
3
3
  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.10
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: 2019-10-21 00:00:00.000000000 Z
11
+ date: 2020-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dig_bang