business_flow 0.19.0 → 0.19.2

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: 358d1c9f044cb27c403f3f09dca2ff62306a43a86b89cbdbd0a5bd2f1052384b
4
- data.tar.gz: 9ace3fc7d47f1f383dbe5a5dcee90891b790bc5dfe602530c3230f5ae2b11db9
3
+ metadata.gz: 594752766329fcaa20e52b6b17f3a0b864fb893453055d24dd8596e0a3f5dac5
4
+ data.tar.gz: c4c8a27b23c2bfdd63378d9a3da1f47e3f9c9f1e0b95eb7344575c30ef2651d0
5
5
  SHA512:
6
- metadata.gz: 12300927b4b0ed87c5961d86709d030059fb3734c54680b17c450a1e3f64d6e28fe2c22c158e9578f24ce137c0a24952bc3c14a501c24332fb7baf292ffedff8
7
- data.tar.gz: b53b551074f8edb4fddc50791e1f6a64682205f49af85b1cbf6915f57677b9ab6f762c4c1e100eee658477f78b9c9abfc7199b5594490524144bf0653e5825a5
6
+ metadata.gz: 0ac739ddbf16363e5d6397be8720205187a9ccaa043a11b26e67ccc33f72f83d354c713d2359ffec27bb8a2c9cd93422922aee25aefcec424cc4bc3c5f76226c
7
+ data.tar.gz: be38502bd0d953729bb48b723540dbc2288f5cd7eb56c5ef54e60854de6c2a4d185604f3d84c681c36906658058863d18ff86eb7a20144ee4a8d1d86fb033f40
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- business_flow (0.19.0)
4
+ business_flow (0.19.2)
5
5
  activemodel (>= 4.2, < 8)
6
6
  activesupport (>= 4.2, < 8)
7
7
 
@@ -66,6 +66,27 @@ module BusinessFlow
66
66
  Callable.new(:_business_flow_dsl_parameters)
67
67
  end
68
68
 
69
+ def clear_cache(parameter_object = {})
70
+ clear_cache!(parameter_object)
71
+ rescue FlowFailedException => exc
72
+ exc.flow
73
+ end
74
+
75
+ def clear_cache!(parameter_object = {})
76
+ flow = build(parameter_object)
77
+ raise FlowFailedException, result_from(flow) if flow.errors?
78
+ ClassMethods.clear_cache(flow)
79
+ end
80
+
81
+ def self.clear_cache(flow)
82
+ klass = flow.class
83
+ klass.instrument(:clear_cache, flow) do |payload|
84
+ ret = klass.cache_store.delete(flow.cache_key)
85
+ payload[:cache_clear] = ret if payload
86
+ ret
87
+ end
88
+ end
89
+
69
90
  def execute(flow)
70
91
  with_cache(flow) do
71
92
  super(flow)._business_flow_cacheable_finalize(flow.cache_key)
@@ -40,6 +40,14 @@ module BusinessFlow
40
40
  raise
41
41
  end
42
42
 
43
+ def read_attribute_for_validation(key)
44
+ if key == :cluster_lock
45
+ ClassMethods.lock_name(self)
46
+ else
47
+ super(key)
48
+ end
49
+ end
50
+
43
51
  # DSL Methods
44
52
  module ClassMethods
45
53
  # Error raised when there is an internal issue with acquiring a lock.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BusinessFlow
4
- VERSION = '0.19.0'.freeze
4
+ VERSION = '0.19.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Scarborough
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-09 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel