motor-admin 0.4.33 → 0.4.34

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
2
  SHA256:
3
- metadata.gz: 0d3073a25a3b0261755507001390f0707e6e795b1cd015426d61e7aad6fb32b8
4
- data.tar.gz: e7aec3bf0ff84b5506142ac1630dacba519b9b844bcc26db4b1bc80bcfd1c854
3
+ metadata.gz: b8c50645e3228b532c70c3455ed170c59c21d7e69f5a0170f13c43174fe6e0c9
4
+ data.tar.gz: 3a50a9787112c88af0a5f39ebc2cb23394f240f694ea8a335641456ab64669d2
5
5
  SHA512:
6
- metadata.gz: 0cf73f7d1a3d96df55598370e84204fb381931702f20457bb21019129eba9b727f4d4600a77471db40eac745bf5aed69605437f8c54e4ec11d3a428719cf2888
7
- data.tar.gz: 24ed3db8df9801d36f0a72cd9eea13bd1fab51e3bd88a08564e9ef32412e871e5f62e870d80d2feebd168f758d2f10fa84bcff9df20f3db2470888913cec9dc0
6
+ metadata.gz: 194f2226d32361a5e1a7ace3f8a49431d4a3d190714741930e8716f1482083907459769b65399235b5c4da0702adc1acc27cd1da0b44427ba97978cbdb58a872
7
+ data.tar.gz: 5a26102b3cd126a565ddbe479c10c30ac99e36c1675a088229b5fd3b09965e2387fad2b9fe219819764bb482496468b5e7ba4ccc59856d62114aa33a2b4b57e3
@@ -1,17 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Motor
4
- class Audit < Audited::Audit
5
- self.table_name = 'motor_audits'
3
+ unless defined?(Motor::Audit)
4
+ module Motor
5
+ class Audit < Audited::Audit
6
+ self.table_name = 'motor_audits'
6
7
 
7
- if Rails.version.to_f >= 7.2
8
- superclass.abstract_class = true
9
- end
8
+ if Rails.version.to_f >= 7.2
9
+ superclass.abstract_class = true
10
+ end
10
11
 
11
- if Rails.version.to_f >= 7.1
12
- serialize :audited_changes, coder: HashSerializer
13
- else
14
- serialize :audited_changes, HashSerializer
12
+ if Rails.version.to_f >= 7.1
13
+ serialize :audited_changes, coder: HashSerializer
14
+ else
15
+ serialize :audited_changes, HashSerializer
16
+ end
15
17
  end
16
18
  end
17
19
  end
@@ -110,15 +110,27 @@ module Motor
110
110
 
111
111
  columns = Resources::CustomSqlColumnsCache.call(config[:custom_sql])
112
112
 
113
+ base_column = klass.connection.schema_cache.columns_hash(klass.table_name).first.last
114
+
113
115
  columns_hash =
114
116
  columns.each_with_object({}) do |column, acc|
115
117
  acc[column[:name]] =
116
- ActiveRecord::ConnectionAdapters::Column.new(
117
- column[:name],
118
- nil,
119
- ActiveRecord::ConnectionAdapters::SqlTypeMetadata.new(sql_type: column[:column_type],
120
- type: column[:column_type].to_sym)
121
- )
118
+ if Rails.version.to_f >= 7.2
119
+ base_column.class.new(
120
+ column[:name],
121
+ nil,
122
+ base_column.sql_type_metadata.class.new(
123
+ ActiveRecord::ConnectionAdapters::SqlTypeMetadata.new(sql_type: column[:column_type],
124
+ type: column[:column_type].to_sym))
125
+ )
126
+ else
127
+ ActiveRecord::ConnectionAdapters::Column.new(
128
+ column[:name],
129
+ nil,
130
+ ActiveRecord::ConnectionAdapters::SqlTypeMetadata.new(sql_type: column[:column_type],
131
+ type: column[:column_type].to_sym)
132
+ )
133
+ end
122
134
  end
123
135
 
124
136
  klass.instance_variable_set(:@__motor_custom_sql_columns_hash, columns_hash)
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.33'
4
+ VERSION = '0.4.34'
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.33
4
+ version: 0.4.34
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-21 00:00:00.000000000 Z
11
+ date: 2024-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ar_lazy_preload