motor-admin 0.4.22 → 0.4.24

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: c865c0857941a1626234b641e4f20a4b961389f8f55639602b287ae7b68334b2
4
- data.tar.gz: 20d007ae2ff17717db20197e8035502fe828940650d0c7c822084e3d51868bb4
3
+ metadata.gz: 073751c55b6f68c411439fa4dfde30a04318eff7a6a1764f4aea09c92998cb17
4
+ data.tar.gz: dd7bd5c8314c137e91cde7cfaa3f2809f645f914ae227c276e1571949388d828
5
5
  SHA512:
6
- metadata.gz: 8d84bf72ace1611c23690b5ab97b3ec5505039afa87f9b9ce64b464bea75268e55baa0db3d9cd2b7ef6b32ba5e5ffce59416e86674582724d0042104f5e7c79b
7
- data.tar.gz: c3d4372c18e32f55050bfd9377e0e28704c4280188a480f3586383e879581c6b6c8596dc2db5ed30d7ae4e60000f9278119762f098691bba6f59634a1ff2774d
6
+ metadata.gz: 2f50cc4819a6d9a3bd6ac0f1b386e969cf3e829cdf7f110cb6273f50cbed459443dfc990e4f7888755f5e9bdcefe71436cfe69ef777da161b3cd2a7634d3cea5
7
+ data.tar.gz: '0095cfc6d0746bf614b79e2345ce5d70df2d4c848c8107d197f2ee6ae3b7eabbd08284360af0639434ac040228b4dd456cd95674b4c4062189fa92f6f0dc6d1a'
@@ -28,7 +28,7 @@ module Motor
28
28
 
29
29
  def respond_with_generic_jwt
30
30
  payload = { uid: current_user.id, exp: GENERIC_TOKEN_TTL.from_now.to_i }
31
- token = JWT.encode(payload, Rails.application.secrets.secret_key_base)
31
+ token = JWT.encode(payload, Rails.application.credentials.secret_key_base)
32
32
 
33
33
  render json: { token: token }
34
34
  end
@@ -46,7 +46,7 @@ module Motor
46
46
 
47
47
  payload = { uid: current_user.id, email: current_user.email, exp: JWT_TTL.from_now.to_i }
48
48
 
49
- JWT.encode(payload, Rails.application.secrets.secret_key_base)
49
+ JWT.encode(payload, Rails.application.credentials.secret_key_base)
50
50
  end
51
51
 
52
52
  def request_params
@@ -38,7 +38,7 @@ module Motor
38
38
 
39
39
  payload = { uid: current_user.id, email: current_user.email, exp: JWT_TTL.from_now.to_i }
40
40
 
41
- JWT.encode(payload, Rails.application.secrets.secret_key_base)
41
+ JWT.encode(payload, Rails.application.credentials.secret_key_base)
42
42
  end
43
43
 
44
44
  def request_params
@@ -12,7 +12,12 @@ module Motor
12
12
  has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag'
13
13
 
14
14
  attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
15
- serialize :preferences, HashSerializer
15
+
16
+ if Rails.version.to_f >= 7.1
17
+ serialize :preferences, coder: HashSerializer
18
+ else
19
+ serialize :preferences, HashSerializer
20
+ end
16
21
 
17
22
  scope :active, -> { where(deleted_at: nil) }
18
23
  scope :enabled, -> { where(is_enabled: true) }
@@ -7,8 +7,13 @@ module Motor
7
7
  attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
8
8
  attribute :credentials, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
9
9
 
10
- serialize :credentials, Motor::HashSerializer
11
- serialize :preferences, Motor::HashSerializer
10
+ if Rails.version.to_f >= 7.1
11
+ serialize :credentials, coder: Motor::HashSerializer
12
+ serialize :preferences, coder: Motor::HashSerializer
13
+ else
14
+ serialize :credentials, Motor::HashSerializer
15
+ serialize :preferences, Motor::HashSerializer
16
+ end
12
17
 
13
18
  has_one :form, dependent: nil, foreign_key: :api_config_name, primary_key: :name, inverse_of: :api_config
14
19
 
@@ -4,6 +4,10 @@ module Motor
4
4
  class Audit < Audited::Audit
5
5
  self.table_name = 'motor_audits'
6
6
 
7
- serialize :audited_changes, HashSerializer
7
+ if Rails.version.to_f >= 7.1
8
+ serialize :audited_changes, coder: HashSerializer
9
+ else
10
+ serialize :audited_changes, HashSerializer
11
+ end
8
12
  end
9
13
  end
@@ -4,6 +4,10 @@ module Motor
4
4
  class Config < ::Motor::ApplicationRecord
5
5
  audited
6
6
 
7
- serialize :value, HashSerializer
7
+ if Rails.version.to_f >= 7.1
8
+ serialize :value, coder: HashSerializer
9
+ else
10
+ serialize :value, HashSerializer
11
+ end
8
12
  end
9
13
  end
@@ -10,7 +10,12 @@ module Motor
10
10
  has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag'
11
11
 
12
12
  attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
13
- serialize :preferences, HashSerializer
13
+
14
+ if Rails.version.to_f >= 7.1
15
+ serialize :preferences, coder: HashSerializer
16
+ else
17
+ serialize :preferences, HashSerializer
18
+ end
14
19
 
15
20
  scope :active, -> { where(deleted_at: nil) }
16
21
 
@@ -11,7 +11,12 @@ module Motor
11
11
  has_many :tags, through: :taggable_tags, class_name: 'Motor::Tag'
12
12
 
13
13
  attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
14
- serialize :preferences, HashSerializer
14
+
15
+ if Rails.version.to_f >= 7.1
16
+ serialize :preferences, coder: HashSerializer
17
+ else
18
+ serialize :preferences, HashSerializer
19
+ end
15
20
 
16
21
  scope :active, -> { where(deleted_at: nil) }
17
22
  end
@@ -11,7 +11,12 @@ module Motor
11
11
  has_many :alerts, dependent: :destroy
12
12
 
13
13
  attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
14
- serialize :preferences, HashSerializer
14
+
15
+ if Rails.version.to_f >= 7.1
16
+ serialize :preferences, coder: HashSerializer
17
+ else
18
+ serialize :preferences, HashSerializer
19
+ end
15
20
 
16
21
  scope :active, -> { where(deleted_at: nil) }
17
22
 
@@ -5,6 +5,11 @@ module Motor
5
5
  audited
6
6
 
7
7
  attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
8
- serialize :preferences, HashSerializer
8
+
9
+ if Rails.version.to_f >= 7.1
10
+ serialize :preferences, coder: HashSerializer
11
+ else
12
+ serialize :preferences, HashSerializer
13
+ end
9
14
  end
10
15
  end
@@ -6,7 +6,7 @@ module Motor
6
6
  def next_migration_number(dirname)
7
7
  next_migration_number = current_migration_number(dirname) + 1
8
8
 
9
- if ::ActiveRecord::Base.timestamped_migrations
9
+ if ::ActiveRecord::Base.try(:timestamped_migrations) || ::ActiveRecord.try(:timestamped_migrations)
10
10
  [Time.now.utc.strftime('%Y%m%d%H%M%S'), format('%.14d', next_migration_number)].max
11
11
  else
12
12
  format('%.3d', next_migration_number)
data/lib/motor/admin.rb CHANGED
@@ -4,6 +4,8 @@ module Motor
4
4
  class Admin < ::Rails::Engine
5
5
  config.custom_html = ''
6
6
 
7
+ ActiveSupport.cache_format_version = Rails.version.to_f
8
+
7
9
  if !Motor.development? && Rails.env.development?
8
10
  config.eager_load_paths.delete(File.expand_path('../../app/controllers', __dir__))
9
11
  config.eager_load_paths.delete(File.expand_path('../../app/controllers/concerns', __dir__))
@@ -67,21 +67,14 @@ module Motor
67
67
 
68
68
  statement = prepare_sql_statement(connection_class, query, limit, variables_hash, filters)
69
69
 
70
- connection_class.transaction do
71
- result =
72
- case connection_class.connection.class.name
73
- when 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter'
74
- PostgresqlExecQuery.call(connection_class.connection, statement)
75
- else
76
- statement = normalize_statement_for_sql(statement)
77
-
78
- connection_class.connection.exec_query(*statement)
79
- end
70
+ case connection_class.connection.class.name
71
+ when 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter'
72
+ PostgresqlExecQuery.call(connection_class.connection, statement)
73
+ else
74
+ statement = normalize_statement_for_sql(statement)
80
75
 
81
- raise ActiveRecord::Rollback
76
+ connection_class.connection.exec_query(*statement)
82
77
  end
83
-
84
- result
85
78
  end
86
79
 
87
80
  def validate_query!(sql)
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.22'
4
+ VERSION = '0.4.24'
5
5
  end
@@ -3964,9 +3964,9 @@
3964
3964
  "images/layers-2x.png": "images/layers-2x.png",
3965
3965
  "images/layers.png": "images/layers.png",
3966
3966
  "images/marker-icon.png": "images/marker-icon.png",
3967
- "main-13a7c05e5e481d3fe39b.css.gz": "main-13a7c05e5e481d3fe39b.css.gz",
3968
- "main-13a7c05e5e481d3fe39b.js.LICENSE.txt": "main-13a7c05e5e481d3fe39b.js.LICENSE.txt",
3969
- "main-13a7c05e5e481d3fe39b.js.gz": "main-13a7c05e5e481d3fe39b.js.gz",
3970
- "main.css": "main-13a7c05e5e481d3fe39b.css",
3971
- "main.js": "main-13a7c05e5e481d3fe39b.js"
3967
+ "main-3b866105d1b5846018e0.css.gz": "main-3b866105d1b5846018e0.css.gz",
3968
+ "main-3b866105d1b5846018e0.js.LICENSE.txt": "main-3b866105d1b5846018e0.js.LICENSE.txt",
3969
+ "main-3b866105d1b5846018e0.js.gz": "main-3b866105d1b5846018e0.js.gz",
3970
+ "main.css": "main-3b866105d1b5846018e0.css",
3971
+ "main.js": "main-3b866105d1b5846018e0.js"
3972
3972
  }
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.22
4
+ version: 0.4.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-15 00:00:00.000000000 Z
11
+ date: 2023-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ar_lazy_preload
@@ -2235,8 +2235,8 @@ files:
2235
2235
  - ui/dist/images/layers-2x.png
2236
2236
  - ui/dist/images/layers.png
2237
2237
  - ui/dist/images/marker-icon.png
2238
- - ui/dist/main-13a7c05e5e481d3fe39b.css.gz
2239
- - ui/dist/main-13a7c05e5e481d3fe39b.js.gz
2238
+ - ui/dist/main-3b866105d1b5846018e0.css.gz
2239
+ - ui/dist/main-3b866105d1b5846018e0.js.gz
2240
2240
  - ui/dist/manifest.json
2241
2241
  homepage:
2242
2242
  licenses:
@@ -2265,7 +2265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2265
2265
  - !ruby/object:Gem::Version
2266
2266
  version: '0'
2267
2267
  requirements: []
2268
- rubygems_version: 3.4.10
2268
+ rubygems_version: 3.5.3
2269
2269
  signing_key:
2270
2270
  specification_version: 4
2271
2271
  summary: Low-code Admin panel and Business intelligence