fix: Account seeder error on staging (#5371)
- Fix for Account seeding error on staging environments
This commit is contained in:
@@ -43,7 +43,7 @@ class SuperAdmin::AccountsController < SuperAdmin::ApplicationController
|
||||
# for more information
|
||||
|
||||
def seed
|
||||
Seeders::AccountSeeder.new(account: requested_resource).perform!
|
||||
Internal::SeedAccountJob.perform_later(requested_resource)
|
||||
redirect_back(fallback_location: [namespace, requested_resource], notice: 'Account seeding triggered')
|
||||
end
|
||||
end
|
||||
|
||||
7
app/jobs/internal/seed_account_job.rb
Normal file
7
app/jobs/internal/seed_account_job.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Internal::SeedAccountJob < ApplicationJob
|
||||
queue_as :low
|
||||
|
||||
def perform(account)
|
||||
Seeders::AccountSeeder.new(account: account).perform!
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if !Rails.env.production? || ENV.fetch('ENABLE_ACCOUNT_SEEDING', nil) %>
|
||||
<% if ENV.fetch('ENABLE_ACCOUNT_SEEDING', !Rails.env.production?) %>
|
||||
<section class="main-content__body">
|
||||
<hr/>
|
||||
<%= form_for([:seed, namespace, page.resource], method: :post, html: { class: "form" }) do |f| %>
|
||||
|
||||
Reference in New Issue
Block a user