active_record_extended 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c136dceff4eb13a4c368aef03c70ae74bf3c856d3dadaa38e468e3f3369455d
|
4
|
+
data.tar.gz: 1d7f194a4760a812e2a6aa22f20e1a62914e68d1fcb52cb223d724104597cc31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0d6e454d6c2dc91d28472cc1911043bc62a94e554d85bc77b0cdbbdedcc4158f7f6f43164a7cd5b27d8609ececf4b532f9a4ebe26c725267c77de4b1c201d38
|
7
|
+
data.tar.gz: 28980520ea5779c79a9fd131157a5b2cdecba1d1fa8464dbba34ef299501094e97db64db303c5d0ad51cf3cb2a52b130562a71d64f866e67f6446ce79082de74
|
@@ -81,7 +81,7 @@ module ActiveRecordExtended
|
|
81
81
|
else
|
82
82
|
replicate_klass = from.respond_to?(:unscoped) ? from.unscoped : @scope.unscoped
|
83
83
|
replicate_klass.from(from.dup, reference_key)
|
84
|
-
end
|
84
|
+
end.unscope(:where)
|
85
85
|
end
|
86
86
|
|
87
87
|
# Will carry defined CTE tables from the nested sub-query and gradually pushes it up to the parents query stack
|
@@ -53,6 +53,13 @@ RSpec.describe "JSON Methods SQL Queries" do
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
context "when the subquery is a STI record type" do
|
58
|
+
it "should not append sti 'type IN(..)' where clauses to the nested query" do
|
59
|
+
query = User.select_row_to_json(AdminSti.where(id: 10), cast_with: :array, key: :convert_this, as: :results).to_sql
|
60
|
+
expect(query).to match_regex(/SELECT \(ARRAY\(SELECT ROW_TO_JSON\("convert_this"\) FROM \(.*\) convert_this\)\) AS .+/)
|
61
|
+
end
|
62
|
+
end
|
56
63
|
end
|
57
64
|
|
58
65
|
describe ".json_build_object" do
|
data/spec/support/models.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_extended
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Protacio-Karaszi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|