back_ops 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 543bd1222115f9fa55b46ef603aaebd4100b8cbf4e817d1d4e598d50106e2227
4
- data.tar.gz: 8fc4ca44128a2d74ca4ca714ebf6dea6139fc0ee0c250f4103314013b5c7bcd2
3
+ metadata.gz: 646d949074659a0b194d5e7b74531f5a9189d9ff2e6f743138f4a77cfe0b38c6
4
+ data.tar.gz: b518e7e56dc5680efb5dc1122e25fceae2192e1f3a07c77fc31112a12f7fe365
5
5
  SHA512:
6
- metadata.gz: b32d62c84c8703135789dc506243f7c5d27cec7e8987bcecf34ae9a78298ef296f0d04e27676132dca5325ef5ee1b2ac356fa413bd43f6eb77537918f66e7e89
7
- data.tar.gz: 88ab67dc53c0604f95edc4f7c8e4d0473d972b7685c42bc558deaebeb714bf7d91921388b703a093ece8caff81d07311e9721a96fb9af49876e9d607f389febd
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
- 'subscription_id' => subscription.id
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.context['subscription_id']
61
+ subscription_id = operation.get(:subscription_id)
62
62
  subscription = Subscription.find(subscription_id)
63
63
  # ...
64
64
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BackOps
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -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.1.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-03-29 00:00:00.000000000 Z
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/master/CHANGELOG.md
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: