delayed_action 0.0.1
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/delayed_action/application.js +13 -0
- data/app/assets/javascripts/delayed_action/delayed_action_results.js +2 -0
- data/app/assets/stylesheets/delayed_action/application.css +15 -0
- data/app/assets/stylesheets/delayed_action/delayed_action_results.css +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/delayed_action/application_controller.rb +4 -0
- data/app/controllers/delayed_action/delayed_action_results_controller.rb +62 -0
- data/app/helpers/delayed_action/application_helper.rb +4 -0
- data/app/helpers/delayed_action/delayed_action_results_helper.rb +4 -0
- data/app/models/delayed_action/delayed_action_result.rb +7 -0
- data/app/views/delayed_action/delayed_action_results/_form.html.erb +33 -0
- data/app/views/delayed_action/delayed_action_results/edit.html.erb +6 -0
- data/app/views/delayed_action/delayed_action_results/index.html.erb +33 -0
- data/app/views/delayed_action/delayed_action_results/new.html.erb +5 -0
- data/app/views/delayed_action/delayed_action_results/show.html.erb +24 -0
- data/app/views/layouts/delayed_action/application.html.erb +14 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20151003163407_create_delayed_action_delayed_action_results.rb +14 -0
- data/lib/delayed_action.rb +5 -0
- data/lib/delayed_action/delayed_action_active_job.rb +28 -0
- data/lib/delayed_action/delayed_action_concern.rb +66 -0
- data/lib/delayed_action/engine.rb +5 -0
- data/lib/delayed_action/version.rb +3 -0
- data/lib/tasks/delayed_action_tasks.rake +4 -0
- data/test/controllers/delayed_action/delayed_action_results_controller_test.rb +52 -0
- data/test/delayed_action_test.rb +7 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +26 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +6 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fixtures/delayed_action/delayed_action_results.yml +13 -0
- data/test/integration/navigation_test.rb +8 -0
- data/test/models/delayed_action/delayed_action_result_test.rb +9 -0
- data/test/test_helper.rb +21 -0
- metadata +171 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5176c203ab1ccd4a7ac188b2845c5ea29417e69d
|
4
|
+
data.tar.gz: a0702cc4d56330bc796c46f47897ebf01a60a117
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f67543c008bf1942c6510a451d8f57904dc88588bfdbcefd2de49cb194994e2b72153b79f10d3c8e091e362fae54d18be206e97d252c172d21606474ac129902
|
7
|
+
data.tar.gz: d0729a08e3b538ac40b4cecefab77390a3b10df82d84a3b9a8bb9cce096a793e515ae243630ef6ec1fbedd12e5733d4a113ac4d4be2030df3ec77e95787d8a81
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2015 Douglas Tarr
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'DelayedAction'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_dependency "delayed_action/application_controller"
|
2
|
+
|
3
|
+
module DelayedAction
|
4
|
+
class DelayedActionResultsController < ApplicationController
|
5
|
+
before_action :set_delayed_action_result, only: [:show, :edit, :update, :destroy]
|
6
|
+
|
7
|
+
# GET /delayed_action_results
|
8
|
+
def index
|
9
|
+
@delayed_action_results = DelayedActionResult.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /delayed_action_results/1
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /delayed_action_results/new
|
17
|
+
def new
|
18
|
+
@delayed_action_result = DelayedActionResult.new
|
19
|
+
end
|
20
|
+
|
21
|
+
# GET /delayed_action_results/1/edit
|
22
|
+
def edit
|
23
|
+
end
|
24
|
+
|
25
|
+
# POST /delayed_action_results
|
26
|
+
def create
|
27
|
+
@delayed_action_result = DelayedActionResult.new(delayed_action_result_params)
|
28
|
+
|
29
|
+
if @delayed_action_result.save
|
30
|
+
redirect_to @delayed_action_result, notice: 'Delayed action result was successfully created.'
|
31
|
+
else
|
32
|
+
render :new
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# PATCH/PUT /delayed_action_results/1
|
37
|
+
def update
|
38
|
+
if @delayed_action_result.update(delayed_action_result_params)
|
39
|
+
redirect_to @delayed_action_result, notice: 'Delayed action result was successfully updated.'
|
40
|
+
else
|
41
|
+
render :edit
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# DELETE /delayed_action_results/1
|
46
|
+
def destroy
|
47
|
+
@delayed_action_result.destroy
|
48
|
+
redirect_to delayed_action_results_url, notice: 'Delayed action result was successfully destroyed.'
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
# Use callbacks to share common setup or constraints between actions.
|
53
|
+
def set_delayed_action_result
|
54
|
+
@delayed_action_result = DelayedActionResult.find(params[:id])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Only allow a trusted parameter "white list" through.
|
58
|
+
def delayed_action_result_params
|
59
|
+
params.require(:delayed_action_result).permit(:result, :request_env, :uuid, :content_type)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<%= form_for(@delayed_action_result) do |f| %>
|
2
|
+
<% if @delayed_action_result.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@delayed_action_result.errors.count, "error") %> prohibited this delayed_action_result from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @delayed_action_result.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :result %><br>
|
16
|
+
<%= f.text_area :result %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<%= f.label :request_env %><br>
|
20
|
+
<%= f.text_area :request_env %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<%= f.label :uuid %><br>
|
24
|
+
<%= f.text_field :uuid %>
|
25
|
+
</div>
|
26
|
+
<div class="field">
|
27
|
+
<%= f.label :content_type %><br>
|
28
|
+
<%= f.text_field :content_type %>
|
29
|
+
</div>
|
30
|
+
<div class="actions">
|
31
|
+
<%= f.submit %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Listing Delayed Action Results</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Result</th>
|
9
|
+
<th>Request env</th>
|
10
|
+
<th>Uuid</th>
|
11
|
+
<th>Content type</th>
|
12
|
+
<th colspan="3"></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
|
16
|
+
<tbody>
|
17
|
+
<% @delayed_action_results.each do |delayed_action_result| %>
|
18
|
+
<tr>
|
19
|
+
<td><%= delayed_action_result.result %></td>
|
20
|
+
<td><%= delayed_action_result.request_env %></td>
|
21
|
+
<td><%= delayed_action_result.uuid %></td>
|
22
|
+
<td><%= delayed_action_result.content_type %></td>
|
23
|
+
<td><%= link_to 'Show', delayed_action_result %></td>
|
24
|
+
<td><%= link_to 'Edit', edit_delayed_action_result_path(delayed_action_result) %></td>
|
25
|
+
<td><%= link_to 'Destroy', delayed_action_result, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
26
|
+
</tr>
|
27
|
+
<% end %>
|
28
|
+
</tbody>
|
29
|
+
</table>
|
30
|
+
|
31
|
+
<br>
|
32
|
+
|
33
|
+
<%= link_to 'New Delayed action result', new_delayed_action_result_path %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Result:</strong>
|
5
|
+
<%= @delayed_action_result.result %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Request env:</strong>
|
10
|
+
<%= @delayed_action_result.request_env %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<strong>Uuid:</strong>
|
15
|
+
<%= @delayed_action_result.uuid %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<strong>Content type:</strong>
|
20
|
+
<%= @delayed_action_result.content_type %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
<%= link_to 'Edit', edit_delayed_action_result_path(@delayed_action_result) %> |
|
24
|
+
<%= link_to 'Back', delayed_action_results_path %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>DelayedAction</title>
|
5
|
+
<%= stylesheet_link_tag "delayed_action/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "delayed_action/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateDelayedActionDelayedActionResults < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :delayed_action_delayed_action_results do |t|
|
4
|
+
t.text :result
|
5
|
+
t.text :request_env
|
6
|
+
t.string :uuid
|
7
|
+
t.string :content_type
|
8
|
+
|
9
|
+
t.timestamps null: false
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index "delayed_action_delayed_action_results", ["uuid"], name: "index_delayed_action_results_on_uuid", unique: true
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class DelayedActionActiveJob < ActiveJob::Base
|
2
|
+
|
3
|
+
queue_as :default
|
4
|
+
|
5
|
+
def perform(result)
|
6
|
+
|
7
|
+
begin
|
8
|
+
# TODO: remove this hack
|
9
|
+
Rack::Timeout.timeout = 0
|
10
|
+
rescue
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
env = JSON.parse(result.request_env)
|
15
|
+
session = ActionDispatch::Integration::Session.new(Rails.application)
|
16
|
+
if env["QUERY_STRING"]
|
17
|
+
env["QUERY_STRING"] = "force=true&#{env["QUERY_STRING"]}"
|
18
|
+
path = "#{env["PATH_INFO"]}?force=true&#{env["QUERY_STRING"]}"
|
19
|
+
else
|
20
|
+
path = "#{env["PATH_INFO"]}?force=true"
|
21
|
+
end
|
22
|
+
puts path
|
23
|
+
session.get path, nil, env
|
24
|
+
result.update(result: session.response.body, content_type: session.response.content_type)
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module DelayedAction
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
included do
|
5
|
+
# raise an error if we are using the inline active job
|
6
|
+
if Rails.env.development?
|
7
|
+
if Rails.application.config.active_job.queue_adapter == :inline
|
8
|
+
raise "ERROR: DelayedAction will cause deadlocks with the :inline active_job queue adapter. Please switch to another adapter, such as delayed_job or resque"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def delayed_action_queue
|
15
|
+
params_to_copy = ["SCRIPT_NAME", "PATH_INFO", "QUERY_STRING", "REQUEST_METHOD", "HTTP_COOKIE", "REQUEST_URI", "SERVER_NAME", "SERVER_PORT", "REMOTE_ADDR", "SERVER_PROTOCOL", "HTTP_HOST", "HTTP_USER_AGENT" , "HTTP_VERSION", "HTTP_X_FORWARDED_PROTO"]
|
16
|
+
request_env = {}
|
17
|
+
params_to_copy.each do |p|
|
18
|
+
request_env[p] = request.env[p]
|
19
|
+
end
|
20
|
+
|
21
|
+
result = DelayedAction::DelayedActionResult.create request_env: request_env.to_json
|
22
|
+
job = DelayedActionActiveJob.perform_later result
|
23
|
+
if request.fullpath.include?("?")
|
24
|
+
path = "#{request.fullpath}&delayed_uuid=#{result.uuid}"
|
25
|
+
else
|
26
|
+
path = "#{request.fullpath}?delayed_uuid=#{result.uuid}"
|
27
|
+
end
|
28
|
+
|
29
|
+
redirect_to path
|
30
|
+
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
def delayed_action_view
|
35
|
+
# unwrap the job, get the results and view it here
|
36
|
+
result = DelayedAction::DelayedActionResult.find_by_uuid(params[:delayed_uuid])
|
37
|
+
if result.result.blank?
|
38
|
+
render html: "<html><head><title>Loading</title><meta http-equiv='refresh' content='5'></head><body>Loading, this page will refresh in 5 seconds. Or, <a href='#{request.fullpath}'>refresh this page</a> for results...</body></html>".html_safe
|
39
|
+
else
|
40
|
+
render body: "#{result.result}", content_type: result.content_type
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def delayed_action_dispatch
|
45
|
+
return if params[:force]
|
46
|
+
|
47
|
+
if params[:delayed_uuid]
|
48
|
+
delayed_action_view
|
49
|
+
else
|
50
|
+
delayed_action_queue
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
module ClassMethods
|
57
|
+
def delayed_action(options = {})
|
58
|
+
actions = options
|
59
|
+
|
60
|
+
before_action :delayed_action_dispatch, only: actions
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|