data_migration_for_rails 0.1.3 → 0.1.4
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 +4 -4
- data/app/controllers/data_migration/imports_controller.rb +1 -1
- data/app/controllers/data_migration/migration_executions_controller.rb +2 -2
- data/app/models/migration_execution.rb +1 -1
- data/app/views/data_migration/migration_executions/index.html.erb +2 -2
- data/app/views/data_migration/migration_executions/show.html.erb +4 -4
- data/lib/data_migration/version.rb +1 -1
- metadata +1 -5
- data/config/initializers/assets.rb +0 -14
- data/config/initializers/content_security_policy.rb +0 -27
- data/config/initializers/inflections.rb +0 -18
- data/config/initializers/permissions_policy.rb +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: afc207a4efe12640b0875035ad6c4167b987346e91f93b03a4ee736273c3fc4e
|
|
4
|
+
data.tar.gz: 677c9f59f2487e33e1b23d9cca93216998755c70cb86cc36455e1857509f2bba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e685b410220d23b47a400d1e14e99bfffa525e968d3536752784ef50a9fae5741c87cb7bd850504069ed7fd2e5f00b64c2414a8aeed5516870201dc88b2b0e1e
|
|
7
|
+
data.tar.gz: 6618f4204e75b1aa606ea272678fd7ecbdbdc0d03c320d6bc3e2811a9d77a173846077f0c592ff66aa67c5e7f89ade5f8da6595a86dfadae8716c61158af5478
|
|
@@ -7,7 +7,7 @@ module DataMigration
|
|
|
7
7
|
def new
|
|
8
8
|
authorize @migration_plan, :execute?
|
|
9
9
|
@filter_params = extract_placeholders_from_plan
|
|
10
|
-
@last_export = @migration_plan.migration_executions.
|
|
10
|
+
@last_export = @migration_plan.migration_executions.export_type.completed.order(created_at: :desc).first
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def create
|
|
@@ -19,7 +19,7 @@ module DataMigration
|
|
|
19
19
|
@action_counts = {}
|
|
20
20
|
|
|
21
21
|
# Only load migration records for import executions
|
|
22
|
-
return unless @execution.
|
|
22
|
+
return unless @execution.import_type?
|
|
23
23
|
|
|
24
24
|
# Reload association to ensure fresh data
|
|
25
25
|
@execution.reload
|
|
@@ -50,7 +50,7 @@ module DataMigration
|
|
|
50
50
|
def download
|
|
51
51
|
authorize @execution, :download?
|
|
52
52
|
|
|
53
|
-
unless @execution.completed? && @execution.
|
|
53
|
+
unless @execution.completed? && @execution.export_type? && @execution.file_path.present?
|
|
54
54
|
redirect_to @execution, alert: 'Export file not available.'
|
|
55
55
|
return
|
|
56
56
|
end
|
|
@@ -7,7 +7,7 @@ class MigrationExecution < ApplicationRecord
|
|
|
7
7
|
has_many :migration_records, dependent: :destroy
|
|
8
8
|
|
|
9
9
|
# Enums
|
|
10
|
-
enum execution_type: { export: 0, import: 1 }
|
|
10
|
+
enum execution_type: { export: 0, import: 1 }, _suffix: :type
|
|
11
11
|
enum status: { pending: 0, running: 1, completed: 2, failed: 3 }
|
|
12
12
|
|
|
13
13
|
# Validations
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<td>
|
|
47
47
|
<% if execution.stats.present? %>
|
|
48
48
|
<small>
|
|
49
|
-
<% if execution.
|
|
49
|
+
<% if execution.export_type? %>
|
|
50
50
|
<%= execution.stats['processed_records'] || 0 %> records
|
|
51
51
|
<% else %>
|
|
52
52
|
<span class="text-success"><%= execution.stats['created'] || 0 %></span> /
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<td>
|
|
60
60
|
<div class="btn-group btn-group-sm">
|
|
61
61
|
<%= link_to "View", execution, class: "btn btn-outline-primary" %>
|
|
62
|
-
<% if execution.completed? && execution.
|
|
62
|
+
<% if execution.completed? && execution.export_type? && execution.file_path.present? %>
|
|
63
63
|
<%= link_to "Download", download_migration_execution_path(execution), class: "btn btn-outline-success" %>
|
|
64
64
|
<% end %>
|
|
65
65
|
</div>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<!-- Statistics -->
|
|
65
65
|
<% if @execution.stats.present? %>
|
|
66
66
|
<div class="row text-center mt-4">
|
|
67
|
-
<% if @execution.
|
|
67
|
+
<% if @execution.export_type? %>
|
|
68
68
|
<div class="col-md-4">
|
|
69
69
|
<div class="card">
|
|
70
70
|
<div class="card-body">
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
<div class="card bg-light">
|
|
133
133
|
<div class="card-body">
|
|
134
134
|
<h4 class="text-success mb-0">
|
|
135
|
-
📎 <%= @execution.stats['processed_attachments'] || 0 %> Attachments <%= @execution.
|
|
135
|
+
📎 <%= @execution.stats['processed_attachments'] || 0 %> Attachments <%= @execution.export_type? ? 'Exported' : 'Imported' %>
|
|
136
136
|
</h4>
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
<% end %>
|
|
143
143
|
|
|
144
144
|
<!-- Download Export -->
|
|
145
|
-
<% if @execution.completed? && @execution.
|
|
145
|
+
<% if @execution.completed? && @execution.export_type? && @execution.file_path.present? %>
|
|
146
146
|
<div class="d-grid gap-2 mt-4">
|
|
147
147
|
<%= link_to "📥 Download Export Archive", download_migration_execution_path(@execution), class: "btn btn-success btn-lg" %>
|
|
148
148
|
</div>
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
</div>
|
|
152
152
|
|
|
153
153
|
<!-- Migration Records -->
|
|
154
|
-
<% if @execution.
|
|
154
|
+
<% if @execution.import_type? && @execution.migration_records.any? %>
|
|
155
155
|
<div class="card">
|
|
156
156
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
157
157
|
<h5 class="mb-0">Processed Records</h5>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: data_migration_for_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vaibhav Rokkam
|
|
@@ -243,12 +243,8 @@ files:
|
|
|
243
243
|
- app/views/users/sessions/new.html.erb
|
|
244
244
|
- app/views/users/shared/_error_messages.html.erb
|
|
245
245
|
- app/views/users/shared/_links.html.erb
|
|
246
|
-
- config/initializers/assets.rb
|
|
247
|
-
- config/initializers/content_security_policy.rb
|
|
248
246
|
- config/initializers/devise.rb
|
|
249
247
|
- config/initializers/filter_parameter_logging.rb
|
|
250
|
-
- config/initializers/inflections.rb
|
|
251
|
-
- config/initializers/permissions_policy.rb
|
|
252
248
|
- config/initializers/warden.rb
|
|
253
249
|
- config/locales/devise.en.yml
|
|
254
250
|
- config/locales/en.yml
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Be sure to restart your server when you modify this file.
|
|
4
|
-
|
|
5
|
-
# Version of your assets, change this if you want to expire all your assets.
|
|
6
|
-
Rails.application.config.assets.version = '1.0'
|
|
7
|
-
|
|
8
|
-
# Add additional assets to the asset load path.
|
|
9
|
-
# Rails.application.config.assets.paths << Emoji.images_path
|
|
10
|
-
|
|
11
|
-
# Precompile additional assets.
|
|
12
|
-
# application.js, application.css, and all non-JS/CSS in the app/assets
|
|
13
|
-
# folder are already added.
|
|
14
|
-
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Be sure to restart your server when you modify this file.
|
|
4
|
-
|
|
5
|
-
# Define an application-wide content security policy.
|
|
6
|
-
# See the Securing Rails Applications Guide for more information:
|
|
7
|
-
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
|
8
|
-
|
|
9
|
-
# Rails.application.configure do
|
|
10
|
-
# config.content_security_policy do |policy|
|
|
11
|
-
# policy.default_src :self, :https
|
|
12
|
-
# policy.font_src :self, :https, :data
|
|
13
|
-
# policy.img_src :self, :https, :data
|
|
14
|
-
# policy.object_src :none
|
|
15
|
-
# policy.script_src :self, :https
|
|
16
|
-
# policy.style_src :self, :https
|
|
17
|
-
# # Specify URI for violation reports
|
|
18
|
-
# # policy.report_uri "/csp-violation-report-endpoint"
|
|
19
|
-
# end
|
|
20
|
-
#
|
|
21
|
-
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
|
22
|
-
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
|
23
|
-
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
|
24
|
-
#
|
|
25
|
-
# # Report violations without enforcing the policy.
|
|
26
|
-
# # config.content_security_policy_report_only = true
|
|
27
|
-
# end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Be sure to restart your server when you modify this file.
|
|
4
|
-
|
|
5
|
-
# Add new inflection rules using the following format. Inflections
|
|
6
|
-
# are locale specific, and you may define rules for as many different
|
|
7
|
-
# locales as you wish. All of these examples are active by default:
|
|
8
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
9
|
-
# inflect.plural /^(ox)$/i, "\\1en"
|
|
10
|
-
# inflect.singular /^(ox)en/i, "\\1"
|
|
11
|
-
# inflect.irregular "person", "people"
|
|
12
|
-
# inflect.uncountable %w( fish sheep )
|
|
13
|
-
# end
|
|
14
|
-
|
|
15
|
-
# These inflection rules are supported but not enabled by default:
|
|
16
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
17
|
-
# inflect.acronym "RESTful"
|
|
18
|
-
# end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Be sure to restart your server when you modify this file.
|
|
4
|
-
|
|
5
|
-
# Define an application-wide HTTP permissions policy. For further
|
|
6
|
-
# information see: https://developers.google.com/web/updates/2018/06/feature-policy
|
|
7
|
-
|
|
8
|
-
# Rails.application.config.permissions_policy do |policy|
|
|
9
|
-
# policy.camera :none
|
|
10
|
-
# policy.gyroscope :none
|
|
11
|
-
# policy.microphone :none
|
|
12
|
-
# policy.usb :none
|
|
13
|
-
# policy.fullscreen :self
|
|
14
|
-
# policy.payment :self, "https://secure.example.com"
|
|
15
|
-
# end
|