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: ab8dafecd59ec48a8db711239f8520ab4174796a
4
- data.tar.gz: 4fa11571bd446f2b30c94b16401c4a4098c851eb
3
+ metadata.gz: 5589ae299275b2682dcaabc687188d08bb39ce36
4
+ data.tar.gz: 519b3a9f0a019ec9473ecd23f791c36f0c4ac831
5
5
  SHA512:
6
- metadata.gz: 5e1fa7c4796f1683312d2fe9679f516c7f22fd44b43cfa05d70e4a6a4cd30508502a49612c6b037005e5b1ba64cb0d9c84b496bb49e8d7990a64486a44d62435
7
- data.tar.gz: d4c7b24ce055e50e45bddd0f66e1304936abb541151dfdc714347882cd244a8ef646798598d28e9b28955ace2d859652c235141c514a144aef0a81fdee325b2d
6
+ metadata.gz: 7c112e6889dbb37a656f864e6d799b0df41b35f7a6cead1f0faf16de990233fd3bc379402d3ef3f6011bd0b420c3e9a01b8439da5e7252774192ce11a62d5ca9
7
+ data.tar.gz: e08956b50dd9c1835c5ec133a4238f4c0ac5e1e499f0f28e862a651800dbd3ec5336a8aeecb674e527101321255d6ebc2eabe2a977fa30bf31229f6e956f06ec
data/Appraisals CHANGED
@@ -1,5 +1,5 @@
1
1
  %w(5.0 5.1 5.2).each do |version|
2
2
  appraise "rails-#{version.gsub(/\./, "-")}" do
3
- gem "rails", "~> #{version}"
3
+ gem "rails", "~> #{version}.0"
4
4
  end
5
5
  end
@@ -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 = klass.connection.select_all(relation.arel)
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'
@@ -1,3 +1,3 @@
1
1
  module RelationToStruct
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
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.0
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-02 00:00:00.000000000 Z
11
+ date: 2019-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal