* Refactored Podcast::GetEpisodesJob to sidekiq * fixing specs * removing env keys * Change arguments to Hash * Update specs and add spec for queue * Update references for Hash argument * Add comment to explain parameters of #perform Co-authored-by: Alex <alexandersmith223@gmail.com>
20 lines
566 B
Ruby
20 lines
566 B
Ruby
module Admin
|
|
class PodcastsController < Admin::ApplicationController
|
|
def create
|
|
resource = resource_class.new(resource_params)
|
|
authorize_resource(resource)
|
|
|
|
if resource.save
|
|
Podcasts::GetEpisodesWorker.perform_async(podcast_id: resource.id) if resource.published
|
|
redirect_to(
|
|
[namespace, resource],
|
|
notice: translate_with_resource("create.success"),
|
|
)
|
|
else
|
|
render :new, locals: {
|
|
page: Administrate::Page::Form.new(dashboard, resource)
|
|
}
|
|
end
|
|
end
|
|
end
|
|
end
|