data_migration_for_rails 0.1.4 → 0.1.5

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: afc207a4efe12640b0875035ad6c4167b987346e91f93b03a4ee736273c3fc4e
4
- data.tar.gz: 677c9f59f2487e33e1b23d9cca93216998755c70cb86cc36455e1857509f2bba
3
+ metadata.gz: e63b71c83e6d3ad8a7ce1303c1e420a2f5d18b52e3c9ae2c8699dffd7d360d03
4
+ data.tar.gz: 632b9805658b6889ceb6294cd674e9481d744a855467fd3d4530331a5992f725
5
5
  SHA512:
6
- metadata.gz: e685b410220d23b47a400d1e14e99bfffa525e968d3536752784ef50a9fae5741c87cb7bd850504069ed7fd2e5f00b64c2414a8aeed5516870201dc88b2b0e1e
7
- data.tar.gz: 6618f4204e75b1aa606ea272678fd7ecbdbdc0d03c320d6bc3e2811a9d77a173846077f0c592ff66aa67c5e7f89ade5f8da6595a86dfadae8716c61158af5478
6
+ metadata.gz: 3fbd6098d10948bc8c6bcde4b45657d6563b5e26a1ae6c4a0e84c6ea2f8e6e9798201af3a06bd14463ec56a65e0ede49545114fd28ee9dc78d70347ff14601d8
7
+ data.tar.gz: be5e7fc77968f04cf807fc870bbd3e27ae562f1b1306327b4e2465daf769885517e44438cc2c1bcd91a215d5519d46ba4f57545e4b9e5aa86ea5357c9374aa4b
data/README.md CHANGED
@@ -24,7 +24,7 @@ A mountable Rails engine for migrating data between Rails application environmen
24
24
  ### 1. Add to Gemfile
25
25
 
26
26
  ```ruby
27
- gem "data_migration_for_rails", "~> 0.1"
27
+ gem "data_migration_for_rails", "~> 0.1", ">= 0.1.4"
28
28
  ```
29
29
 
30
30
  ### 2. Install and Migrate
@@ -21,6 +21,7 @@ module DataMigration
21
21
 
22
22
  def create
23
23
  @migration_plan = MigrationPlan.new(migration_plan_params)
24
+ @migration_plan.user = current_user
24
25
  authorize @migration_plan
25
26
 
26
27
  if @migration_plan.save
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Users
4
- class SessionsController < Devise::SessionsController
3
+ module DataMigration
4
+ module Users
5
+ class SessionsController < Devise::SessionsController
5
6
  # Skip CSRF verification for the new action to handle Devise FailureApp redirects
6
7
  skip_before_action :verify_authenticity_token, only: [:new]
7
8
 
@@ -26,5 +27,6 @@ module Users
26
27
  # def configure_sign_in_params
27
28
  # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
28
29
  # end
30
+ end
29
31
  end
30
32
  end
@@ -21,7 +21,7 @@ module DataMigration
21
21
  @user = DataMigrationUser.new(user_params)
22
22
 
23
23
  if @user.save
24
- redirect_to users_path, notice: 'User created successfully.'
24
+ redirect_to '/data_migration/users', notice: 'User created successfully.'
25
25
  else
26
26
  render :new, status: :unprocessable_entity
27
27
  end
@@ -42,7 +42,7 @@ module DataMigration
42
42
  end
43
43
 
44
44
  if @user.update(params_to_update)
45
- redirect_to users_path, notice: 'User updated successfully.'
45
+ redirect_to '/data_migration/users', notice: 'User updated successfully.'
46
46
  else
47
47
  render :edit, status: :unprocessable_entity
48
48
  end
@@ -52,9 +52,9 @@ module DataMigration
52
52
  authorize @user
53
53
 
54
54
  if @user.destroy
55
- redirect_to users_path, notice: 'User deleted successfully.'
55
+ redirect_to '/data_migration/users', notice: 'User deleted successfully.'
56
56
  else
57
- redirect_to users_path, alert: @user.errors.full_messages.join(', ')
57
+ redirect_to '/data_migration/users', alert: @user.errors.full_messages.join(', ')
58
58
  end
59
59
  end
60
60
 
@@ -65,7 +65,7 @@ module DataMigration
65
65
  end
66
66
 
67
67
  def user_params
68
- params.require(:user).permit(:name, :email, :password, :password_confirmation, :role)
68
+ params.require(:data_migration_user).permit(:name, :email, :password, :password_confirmation, :role)
69
69
  end
70
70
  end
71
71
  end
@@ -1,4 +1,4 @@
1
- <%= form_with(model: user, url: user.new_record? ? users_path : user_path(user), local: true) do |form| %>
1
+ <%= form_with(model: user, url: user.new_record? ? '/data_migration/users' : '/data_migration/users/' + user.id.to_s, local: true) do |form| %>
2
2
  <% if user.errors.any? %>
3
3
  <div class="alert alert-danger">
4
4
  <h4><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h4>
@@ -45,5 +45,5 @@
45
45
  </div>
46
46
 
47
47
  <%= form.submit user.new_record? ? "Create User" : "Update User", class: "btn btn-primary" %>
48
- <%= link_to "Cancel", users_path, class: "btn btn-secondary" %>
48
+ <%= link_to "Cancel", '/data_migration/users', class: "btn btn-secondary" %>
49
49
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <div class="d-flex justify-content-between align-items-center mb-4">
2
2
  <h1>Users</h1>
3
- <%= link_to "New User", new_user_path, class: "btn btn-primary" %>
3
+ <%= link_to "New User", '/data_migration/users/new', class: "btn btn-primary" %>
4
4
  </div>
5
5
 
6
6
  <div class="table-responsive">
@@ -26,9 +26,9 @@
26
26
  </td>
27
27
  <td><%= time_ago_in_words(user.created_at) %> ago</td>
28
28
  <td>
29
- <%= link_to "Edit", edit_user_path(user), class: "btn btn-sm btn-outline-warning" %>
29
+ <%= link_to "Edit", '/data_migration/users/' + user.id.to_s + '/edit', class: "btn btn-sm btn-outline-warning" %>
30
30
  <% if user != current_user %>
31
- <%= button_to "Delete", user_path(user),
31
+ <%= button_to "Delete", '/data_migration/users/' + user.id.to_s,
32
32
  method: :delete,
33
33
  class: "btn btn-sm btn-outline-danger",
34
34
  data: { confirm: "Are you sure?" } %>
@@ -22,15 +22,15 @@
22
22
 
23
23
  <% if policy(@user).change_role? && @user.id != current_user.id %>
24
24
  <div class="btn-group btn-group-sm ms-3">
25
- <%= button_to "Make Viewer", change_role_user_path(@user, role: :viewer),
25
+ <%= button_to "Make Viewer", '/data_migration/users/' + @user.id.to_s + '?role=viewer',
26
26
  method: :patch,
27
27
  class: "btn btn-sm btn-outline-secondary #{'active' if @user.viewer?}",
28
28
  data: { confirm: "Change #{@user.email} to Viewer?" } %>
29
- <%= button_to "Make Operator", change_role_user_path(@user, role: :operator),
29
+ <%= button_to "Make Operator", '/data_migration/users/' + @user.id.to_s + '?role=operator',
30
30
  method: :patch,
31
31
  class: "btn btn-sm btn-outline-warning #{'active' if @user.operator?}",
32
32
  data: { confirm: "Change #{@user.email} to Operator?" } %>
33
- <%= button_to "Make Admin", change_role_user_path(@user, role: :admin),
33
+ <%= button_to "Make Admin", '/data_migration/users/' + @user.id.to_s + '?role=admin',
34
34
  method: :patch,
35
35
  class: "btn btn-sm btn-outline-danger #{'active' if @user.admin?}",
36
36
  data: { confirm: "Change #{@user.email} to Admin?" } %>
@@ -126,7 +126,7 @@
126
126
 
127
127
  <div class="card mt-3">
128
128
  <div class="card-body">
129
- <%= link_to "← Back to Users", users_path, class: "btn btn-secondary w-100" %>
129
+ <%= link_to "← Back to Users", '/data_migration/users', class: "btn btn-secondary w-100" %>
130
130
  </div>
131
131
  </div>
132
132
  </div>
@@ -16,7 +16,7 @@
16
16
  </li>
17
17
  <% if current_user.admin? %>
18
18
  <li class="nav-item">
19
- <%= link_to "Users", users_path, class: "nav-link" %>
19
+ <%= link_to "Users", '/data_migration/users', class: "nav-link" %>
20
20
  </li>
21
21
  <% end %>
22
22
  </ul>
data/config/routes.rb CHANGED
@@ -4,7 +4,7 @@ DataMigration::Engine.routes.draw do
4
4
  # Devise routes for DataMigrationUser
5
5
  devise_for :users, class_name: 'DataMigrationUser',
6
6
  controllers: {
7
- sessions: 'users/sessions'
7
+ sessions: 'data_migration/users/sessions'
8
8
  },
9
9
  path: '',
10
10
  path_names: {
@@ -15,7 +15,7 @@ DataMigration::Engine.routes.draw do
15
15
 
16
16
  # Define root path with devise_scope
17
17
  devise_scope :user do
18
- root to: 'users/sessions#new'
18
+ root to: 'data_migration/users/sessions#new'
19
19
 
20
20
  # Registration routes for password changes only (edit/update)
21
21
  resource :registration,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DataMigration
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
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
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vaibhav Rokkam
@@ -190,8 +190,8 @@ files:
190
190
  - app/controllers/data_migration/migration_executions_controller.rb
191
191
  - app/controllers/data_migration/migration_plans_controller.rb
192
192
  - app/controllers/data_migration/migration_steps_controller.rb
193
+ - app/controllers/data_migration/users/sessions_controller.rb
193
194
  - app/controllers/data_migration/users_controller.rb
194
- - app/controllers/users/sessions_controller.rb
195
195
  - app/helpers/data_migration/application_helper.rb
196
196
  - app/jobs/application_job.rb
197
197
  - app/jobs/export_job.rb
@@ -234,15 +234,15 @@ files:
234
234
  - app/views/data_migration/users/edit.html.erb
235
235
  - app/views/data_migration/users/index.html.erb
236
236
  - app/views/data_migration/users/new.html.erb
237
+ - app/views/data_migration/users/registrations/edit.html.erb
238
+ - app/views/data_migration/users/sessions/new.html.erb
239
+ - app/views/data_migration/users/shared/_error_messages.html.erb
240
+ - app/views/data_migration/users/shared/_links.html.erb
237
241
  - app/views/data_migration/users/show.html.erb
238
242
  - app/views/layouts/_navbar.html.erb
239
243
  - app/views/layouts/data_migration.html.erb
240
244
  - app/views/layouts/mailer.html.erb
241
245
  - app/views/layouts/mailer.text.erb
242
- - app/views/users/registrations/edit.html.erb
243
- - app/views/users/sessions/new.html.erb
244
- - app/views/users/shared/_error_messages.html.erb
245
- - app/views/users/shared/_links.html.erb
246
246
  - config/initializers/devise.rb
247
247
  - config/initializers/filter_parameter_logging.rb
248
248
  - config/initializers/warden.rb