back_ops 0.1.0 → 0.2.0
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/README.md +2 -2
- data/lib/back_ops/operation.rb +9 -0
- data/lib/back_ops/version.rb +1 -1
- data/lib/back_ops/worker.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 646d949074659a0b194d5e7b74531f5a9189d9ff2e6f743138f4a77cfe0b38c6
|
4
|
+
data.tar.gz: b518e7e56dc5680efb5dc1122e25fceae2192e1f3a07c77fc31112a12f7fe365
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecf941da420913829f16a23664205ba764c6de6bedfba890ee2df4aaaff2873566250c5d0f79c413fe6067fe12cdf633a2b4ab127aab61f8f05a2901be89e971
|
7
|
+
data.tar.gz: fc9147cd476a9ba12d091c3843360f6032ea572dca2be6f4d4c8287e40b36122844226fa389424e2f645bd09f54852b2af0b930f989fdec851537dd86851cdaa
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ module Subscriptions
|
|
39
39
|
class Fullfillment
|
40
40
|
def self.call(subscription)
|
41
41
|
BackOps::Worker.perform_async({
|
42
|
-
|
42
|
+
subscription_id: subscription.id
|
43
43
|
}, [
|
44
44
|
Subscriptions::Actions::Fulfillment::ChargeCreditCard,
|
45
45
|
Subscriptions::Actions::Fulfillment::SendEmailReceipt
|
@@ -58,7 +58,7 @@ module Subscriptions
|
|
58
58
|
module Fulfillment
|
59
59
|
class ChargeCreditCard
|
60
60
|
def self.call(operation)
|
61
|
-
subscription_id = operation.
|
61
|
+
subscription_id = operation.get(:subscription_id)
|
62
62
|
subscription = Subscription.find(subscription_id)
|
63
63
|
# ...
|
64
64
|
end
|
data/lib/back_ops/operation.rb
CHANGED
@@ -22,5 +22,14 @@ module BackOps
|
|
22
22
|
self.table_name = 'back_ops_operations'
|
23
23
|
|
24
24
|
# == Instance Methods =====================================================
|
25
|
+
|
26
|
+
def get(field)
|
27
|
+
context[field.to_s]
|
28
|
+
end
|
29
|
+
|
30
|
+
def set(field, value)
|
31
|
+
context[field.to_s] = value
|
32
|
+
save!
|
33
|
+
end
|
25
34
|
end
|
26
35
|
end
|
data/lib/back_ops/version.rb
CHANGED
data/lib/back_ops/worker.rb
CHANGED
@@ -29,6 +29,7 @@ module BackOps
|
|
29
29
|
|
30
30
|
def self.setup_operation_and_actions(context, actions)
|
31
31
|
raise ArgumentError, 'Cannot process empty actions' if actions.blank?
|
32
|
+
context.deep_stringify_keys!
|
32
33
|
|
33
34
|
operation = BackOps::Operation.create_or_find_by({
|
34
35
|
params_hash: Digest::MD5.hexdigest("#{context}|#{actions}"),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: back_ops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Price
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -118,7 +118,7 @@ licenses:
|
|
118
118
|
metadata:
|
119
119
|
homepage_uri: https://github.com/aaronprice/back_ops
|
120
120
|
source_code_uri: https://github.com/aaronprice/back_ops
|
121
|
-
changelog_uri: https://github.com/aaronprice/back_ops/blob/
|
121
|
+
changelog_uri: https://github.com/aaronprice/back_ops/blob/main/CHANGELOG.md
|
122
122
|
post_install_message:
|
123
123
|
rdoc_options: []
|
124
124
|
require_paths:
|