motor-admin 0.4.31 → 0.4.32

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: 744cbb9dcbd0e7cb01bec5fb771e50e52db58cc0adb9634ea80bd5dd02ffc2f3
4
- data.tar.gz: 38ddbed12cb036e8ff51e84615541c71fa62d795633ea84044bff0e71817d9c9
3
+ metadata.gz: 95d575b62467d856f7458dbd4780874c4fedbf16f73a21c7e1311cfed705d4f5
4
+ data.tar.gz: c186b45675f5596f58e1ac5741861945f91c5a32bb3d3b3ccf348fe18295ec6d
5
5
  SHA512:
6
- metadata.gz: f32d7ed6a65d87dc067ae3e8458918826789419d17b1cc206dca49da8c53462e0e6d0346ec5f17b6d83ddaceb289f1a4f70ee44d06d2d19938681dc1fb95d6a9
7
- data.tar.gz: bac8cf16d33d9f3ef297757e46fc13eb89c73d117b1170c868cd9ed334bf8ecd7c7b5539e729b3647136ce44be1864a0bf35f6c03706dee2a4ca89973b2500ba
6
+ metadata.gz: 911204a500ef90741cb9e055850a54a5326fef55e2f5e2785c8818ef90f706604c6f798fc34a7a175da1ddd7324eee50cb35f2a13b69b575371b1b34a5469682
7
+ data.tar.gz: 81baa7e705ee2e4e65aacc1a5ea53f49df337188a2378beb411c0bff7ca7e43fb40e130d82dce3ccd50e85d76e116abd8eda932f6eaee1f531a6f8f653c3f291
@@ -2,12 +2,6 @@
2
2
 
3
3
  module Motor
4
4
  module WrapIoParams
5
- extend ActiveSupport::Concern
6
-
7
- included do
8
- before_action :wrap_io_params, only: %i[update create]
9
- end
10
-
11
5
  private
12
6
 
13
7
  def wrap_io_params(hash = params)
@@ -4,6 +4,8 @@ module Motor
4
4
  class ActiveStorageAttachmentsController < ApiBaseController
5
5
  include Motor::WrapIoParams
6
6
 
7
+ before_action :wrap_io_params, only: :create
8
+
7
9
  wrap_parameters :data, except: %i[include fields]
8
10
 
9
11
  load_and_authorize_resource :attachment, class: 'ActiveStorage::Attachment', parent: false
@@ -7,6 +7,8 @@ module Motor
7
7
  include Motor::WrapIoParams
8
8
  include Motor::LoadAndAuthorizeDynamicResource
9
9
 
10
+ before_action :wrap_io_params, only: %i[update create]
11
+
10
12
  def index
11
13
  @resources = Motor::ApiQuery.call(@resources, params)
12
14
 
@@ -70,7 +70,7 @@ module Motor
70
70
  when 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter'
71
71
  PostgresqlExecQuery.call(connection_class.connection, statement)
72
72
  else
73
- statement = normalize_statement_for_sql(statement)
73
+ statement = normalize_statement_for_sql(connection_class.connection, statement)
74
74
 
75
75
  connection_class.connection.exec_query(*statement)
76
76
  end
@@ -219,12 +219,12 @@ module Motor
219
219
 
220
220
  # @param array [Array]
221
221
  # @return [Array]
222
- def normalize_statement_for_sql(statement)
222
+ def normalize_statement_for_sql(conn, statement)
223
223
  sql, _, attributes = statement
224
224
 
225
- sql = ActiveRecord::Base.send(:replace_bind_variables,
226
- sql.gsub(STATEMENT_VARIABLE_REGEXP, '?'),
227
- attributes.map(&:value))
225
+ params = [sql.gsub(STATEMENT_VARIABLE_REGEXP, '?'), attributes.map(&:value)]
226
+ params.unshift(conn) if Rails.version.to_f >= 7.2
227
+ sql = ActiveRecord::Base.send(:replace_bind_variables, *params)
228
228
 
229
229
  [sql, 'SQL', []]
230
230
  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.31'
4
+ VERSION = '0.4.32'
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.31
4
+ version: 0.4.32
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-10-05 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ar_lazy_preload