motor-admin 0.2.44 → 0.2.47

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: e9774b3cabe749ee5509ad9a2a150123dfd83ea55815564847c6beae68c581aa
4
- data.tar.gz: 7b07c88897ae49a141bd63185fbccf3de643eb8a631e7cdfc9c567868536967b
3
+ metadata.gz: 7c12ad8020cd49c64760d1e544167c237863738b495b0be60aa070f93191bf8d
4
+ data.tar.gz: 0b6386ecef9c7b689c52d67f2ebfc8b87057c0b3373cf0ca6aaed944054ff140
5
5
  SHA512:
6
- metadata.gz: 8d999e6cb4761d8857d8c506a5346f1c91d96e98e590b5462c405aca4adb6de34315c12f1dc8a569f7a717b58fce5c5bb4c944c41075f6307a15877c8d355330
7
- data.tar.gz: edacc9def5aa059789e03c32479510716a5e6018fef5353ab3ba95487e0416087efcaff4d6b07f727dacf18f580290d0c347393c144aae2efb91113e6dbc7365
6
+ metadata.gz: 408c8d3f7995518d226f91e7db296f32618bf8015a0dd999c3725c5252594822ae3c6b2053f9c54e3c0d07a7564b5c56ecc26a127b045242a4b5697f711fde8c
7
+ data.tar.gz: 23358591d492b92bd02f34de7a6ca495f148ee68709af54a5b35ccebc9e4f0bb94226857ed92ce86a4ca4a0070c0c6eecef200d7c198a3fdcf2a767d2d7e49d9
@@ -40,13 +40,19 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
40
40
 
41
41
  add_column :motor_forms, :api_config_name, :string
42
42
 
43
+ MotorForm.reset_column_information
44
+
43
45
  MotorForm.all.each do |form|
44
46
  if form.api_path.starts_with?('http')
45
47
  url = form.api_path[%r{\Ahttps?://[^/]+}]
46
48
 
47
- form.preferences[:default_values_api_path]&.delete(url)
49
+ if form.preferences[:default_values_api_path].present?
50
+ form.preferences[:default_values_api_path] =
51
+ form.preferences[:default_values_api_path].delete_prefix(url).sub(/\A\/?/, '/')
52
+ end
53
+
48
54
  form.update!(api_config_name: MotorApiConfig.find_or_create_by!(name: url, url: url).name,
49
- api_path: form.api_path.delete(url))
55
+ api_path: form.api_path.delete_prefix(url).sub(/\A\/?/, '/'))
50
56
  else
51
57
  form.update!(api_config_name: MotorApiConfig.find_or_create_by!(name: 'origin', url: '/').name)
52
58
  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.2.44'
4
+ VERSION = '0.2.47'
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.2.44
4
+ version: 0.2.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2021-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-filter