relation_to_struct 1.6.0 → 1.7.0

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
- SHA1:
3
- metadata.gz: d1ffdbfc2950c798cd223660370ca62ee6a8128b
4
- data.tar.gz: 246947abe7a8f85d6c2558a3b33a0b027547ada4
2
+ SHA256:
3
+ metadata.gz: f11031515a2afe3d55c8cfb98a664eb984079514c727233c74f341be071a825d
4
+ data.tar.gz: 4b97b2856f8529291ea4db5a97bc95b6b58ce5d4b4fbb3eaba066b54a3b317bf
5
5
  SHA512:
6
- metadata.gz: 25ef491ea1f470beea129c8e1d5f92308773092ef470afaadedd56ec9046ad1950d4192e1e61efa816966ecf0dc5eafe40c23bc33ed0572424d0c82368d6cbdf
7
- data.tar.gz: 8a8f2eebe3192ae4d3947a309adfd476e903af1bc754496d1f53f03d8040afb8ad12f12f640a4f69dcc54179b015b02399a19b2d712420b0dabed21fff561c2a
6
+ metadata.gz: 48ab91406c6acb33100fc8849b2f7ded38ca7a32b199f090d4bd388219b22a615c89f0853d211fa64b2f9b57ba83cf17de4499dc114f2a70578f449c3f389029
7
+ data.tar.gz: 9f004fded83df12de47eb94047e0245989f700edd63256af1ee9049b7657126603a0460d49ff54ee1ea67267f4ecfac8b0b7843ee28b8ae33af384ae46b0b53a
data/Appraisals CHANGED
@@ -1,7 +1,7 @@
1
- %w(5.0 5.1 5.2 6.0).each do |version|
1
+ %w(5.0 5.1 5.2 6.0 6.1 7.0).each do |version|
2
2
  appraise "rails-#{version.gsub(/\./, "-")}" do
3
3
  gem "rails", "~> #{version}.0"
4
- if version[0] == '6'
4
+ if Gem::Version.new(version) >= Gem::Version.new("6.0.0")
5
5
  gem "sqlite3", "~> 1.4.0"
6
6
  else
7
7
  gem "sqlite3", "~> 1.3.0"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.1.0"
6
+ gem "sqlite3", "~> 1.4.0"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.0.0"
6
+ gem "sqlite3", "~> 1.4.0"
7
+
8
+ gemspec path: "../"
@@ -1,3 +1,3 @@
1
1
  module RelationToStruct
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  end
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "pry-byebug"
27
27
  spec.add_development_dependency "pg"
28
28
 
29
- spec.add_dependency "activerecord", ">= 5.0", "< 7"
30
- spec.add_dependency "activesupport", ">= 5.0", "< 7"
29
+ spec.add_dependency "activerecord", ">= 5.0", "< 7.1"
30
+ spec.add_dependency "activesupport", ">= 5.0", "< 7.1"
31
31
  end
@@ -14,7 +14,12 @@ ActiveRecord::Base.configurations = {
14
14
  }
15
15
 
16
16
  env = ENV['DATABASE'] ||= 'sqlite'
17
- config = ActiveRecord::Base.configurations[env]
17
+ config =
18
+ if ActiveRecord::VERSION::MAJOR < 7
19
+ ActiveRecord::Base.configurations[env]
20
+ else
21
+ ActiveRecord::Base.configurations.configs_for(env_name: env).first
22
+ end
18
23
 
19
24
  case env
20
25
  when 'postgresql'
@@ -57,7 +57,7 @@ describe ActiveRecord::Relation do
57
57
  it 'properly casts values from arbitrary calculated columns' do
58
58
  hayek = Economist.create!(name: 'F.A. Hayek')
59
59
  scope = Economist.all
60
- pluck_results = scope.pluck("date('now')")
60
+ pluck_results = scope.pluck(Arel.sql("date('now')"))
61
61
  pluck_column_klass = pluck_results.first.class
62
62
 
63
63
  date_struct = Struct.new(:date)
data/spec/spec_helper.rb CHANGED
@@ -14,7 +14,7 @@ def active_record_supports_arrays?
14
14
  Economist.create!(name: 'F.A. Hayek')
15
15
  Economist.create!(name: 'Ludwig von Mises')
16
16
 
17
- pluck_results = Economist.select('name').order('id').limit(1).pluck('array[name]') rescue nil
17
+ pluck_results = Economist.select('name').order('id').limit(1).pluck(Arel.sql('array[name]')) rescue nil
18
18
  if pluck_results
19
19
  raise StandardError, "Unexpected array query results" unless pluck_results == [['F.A. Hayek']] # Verify ActiveRecord interface.
20
20
  supports_arrays = true
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.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coleman
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-12 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '5.0'
118
118
  - - "<"
119
119
  - !ruby/object:Gem::Version
120
- version: '7'
120
+ version: '7.1'
121
121
  type: :runtime
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ dependencies:
127
127
  version: '5.0'
128
128
  - - "<"
129
129
  - !ruby/object:Gem::Version
130
- version: '7'
130
+ version: '7.1'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: activesupport
133
133
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: '5.0'
138
138
  - - "<"
139
139
  - !ruby/object:Gem::Version
140
- version: '7'
140
+ version: '7.1'
141
141
  type: :runtime
142
142
  prerelease: false
143
143
  version_requirements: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ dependencies:
147
147
  version: '5.0'
148
148
  - - "<"
149
149
  - !ruby/object:Gem::Version
150
- version: '7'
150
+ version: '7.1'
151
151
  description: ''
152
152
  email:
153
153
  - jtc331@gmail.com
@@ -166,6 +166,8 @@ files:
166
166
  - gemfiles/rails_5_1.gemfile
167
167
  - gemfiles/rails_5_2.gemfile
168
168
  - gemfiles/rails_6_0.gemfile
169
+ - gemfiles/rails_6_1.gemfile
170
+ - gemfiles/rails_7_0.gemfile
169
171
  - lib/relation_to_struct.rb
170
172
  - lib/relation_to_struct/active_record_base_extension.rb
171
173
  - lib/relation_to_struct/active_record_connection_adapter_extension.rb
@@ -185,7 +187,7 @@ homepage: ''
185
187
  licenses:
186
188
  - MIT
187
189
  metadata: {}
188
- post_install_message:
190
+ post_install_message:
189
191
  rdoc_options: []
190
192
  require_paths:
191
193
  - lib
@@ -200,9 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
202
  - !ruby/object:Gem::Version
201
203
  version: '0'
202
204
  requirements: []
203
- rubyforge_project:
204
- rubygems_version: 2.5.2.3
205
- signing_key:
205
+ rubygems_version: 3.1.6
206
+ signing_key:
206
207
  specification_version: 4
207
208
  summary: Return struct results from ActiveRecord relation queries
208
209
  test_files: