motor-admin 0.4.32 → 0.4.33

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: 95d575b62467d856f7458dbd4780874c4fedbf16f73a21c7e1311cfed705d4f5
4
- data.tar.gz: c186b45675f5596f58e1ac5741861945f91c5a32bb3d3b3ccf348fe18295ec6d
3
+ metadata.gz: 0d3073a25a3b0261755507001390f0707e6e795b1cd015426d61e7aad6fb32b8
4
+ data.tar.gz: e7aec3bf0ff84b5506142ac1630dacba519b9b844bcc26db4b1bc80bcfd1c854
5
5
  SHA512:
6
- metadata.gz: 911204a500ef90741cb9e055850a54a5326fef55e2f5e2785c8818ef90f706604c6f798fc34a7a175da1ddd7324eee50cb35f2a13b69b575371b1b34a5469682
7
- data.tar.gz: 81baa7e705ee2e4e65aacc1a5ea53f49df337188a2378beb411c0bff7ca7e43fb40e130d82dce3ccd50e85d76e116abd8eda932f6eaee1f531a6f8f653c3f291
6
+ metadata.gz: 0cf73f7d1a3d96df55598370e84204fb381931702f20457bb21019129eba9b727f4d4600a77471db40eac745bf5aed69605437f8c54e4ec11d3a428719cf2888
7
+ data.tar.gz: 24ed3db8df9801d36f0a72cd9eea13bd1fab51e3bd88a08564e9ef32412e871e5f62e870d80d2feebd168f758d2f10fa84bcff9df20f3db2470888913cec9dc0
@@ -6,21 +6,30 @@ module Motor
6
6
  module_function
7
7
 
8
8
  def call(conn, statement)
9
- conn.send(:execute_and_clear, *statement) do |result|
10
- types = {}
11
- fields = result.fields
12
-
13
- fields.each_with_index do |fname, i|
14
- ftype = result.ftype i
15
- fmod = result.fmod i
16
- types[fname] = conn.send(:get_oid_type, ftype, fmod, fname)
9
+ if Rails.version.to_f >= 8.0
10
+ result = conn.send(:internal_execute, *statement)
11
+ process_result(conn, result)
12
+ else
13
+ conn.send(:execute_and_clear, *statement) do |result|
14
+ process_result(conn, result)
17
15
  end
16
+ end
17
+ end
18
18
 
19
- if conn.respond_to?(:build_result, true)
20
- conn.send(:build_result, columns: fields, rows: result.values, column_types: types)
21
- else
22
- ActiveRecord::Result.new(fields, result.values, types)
23
- end
19
+ def process_result(conn, result)
20
+ types = {}
21
+ fields = result.fields
22
+
23
+ fields.each_with_index do |fname, i|
24
+ ftype = result.ftype i
25
+ fmod = result.fmod i
26
+ types[fname] = conn.send(:get_oid_type, ftype, fmod, fname)
27
+ end
28
+
29
+ if conn.respond_to?(:build_result, true)
30
+ conn.send(:build_result, columns: fields, rows: result.values, column_types: types)
31
+ else
32
+ ActiveRecord::Result.new(fields, result.values, types)
24
33
  end
25
34
  end
26
35
  end
data/lib/motor/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motor
4
- VERSION = '0.4.32'
4
+ VERSION = '0.4.33'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motor-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.32
4
+ version: 0.4.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-12 00:00:00.000000000 Z
11
+ date: 2024-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ar_lazy_preload