relation_to_struct 1.4.0 → 1.4.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5589ae299275b2682dcaabc687188d08bb39ce36
|
4
|
+
data.tar.gz: 519b3a9f0a019ec9473ecd23f791c36f0c4ac831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c112e6889dbb37a656f864e6d799b0df41b35f7a6cead1f0faf16de990233fd3bc379402d3ef3f6011bd0b420c3e9a01b8439da5e7252774192ce11a62d5ca9
|
7
|
+
data.tar.gz: e08956b50dd9c1835c5ec133a4238f4c0ac5e1e499f0f28e862a651800dbd3ec5336a8aeecb674e527101321255d6ebc2eabe2a977fa30bf31229f6e956f06ec
|
data/Appraisals
CHANGED
@@ -8,7 +8,12 @@ module RelationToStruct::ActiveRecordRelationExtension
|
|
8
8
|
|
9
9
|
# See the definition of #pluck in:
|
10
10
|
# activerecord/lib/active_record/relation/calculations.rb
|
11
|
-
result =
|
11
|
+
result = nil
|
12
|
+
if ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR < 2
|
13
|
+
result = klass.connection.select_all(relation.arel, nil, bound_attributes)
|
14
|
+
else
|
15
|
+
result = klass.connection.select_all(relation.arel)
|
16
|
+
end
|
12
17
|
|
13
18
|
if result.columns.size != struct_class.members.size
|
14
19
|
raise ArgumentError, 'Expected struct fields and columns lengths to be equal'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relation_to_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Coleman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01
|
11
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|