petri_flow 0.2.3 → 0.2.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08a1f7f65f84fd9f8ffbdec71efa97d6c5d9fba3446857a5f08b69930fe734a9'
|
4
|
+
data.tar.gz: f64502b080933aae92cd9b61b027f3451e4f4e7ec90fd45bcf67857c23ce7ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 856886ed111aab29361a47b1e24ef17d1a5340d0d3d4838581ccfb852a24f8cfabca81fcb6548396a574e471b7086b1e87e73be907cbc8231bf8fe6546c284ac
|
7
|
+
data.tar.gz: ff320c2ed77ec2021f78054a8cd23cdeae188e78494deda3bbd534a94399c7e36ef16fae550414f26d5c54ed95d78a3473e2a5c5b49023735c38ffb1c264737a
|
data/README.md
CHANGED
@@ -82,26 +82,26 @@ Wf.org_classes = { group: "::Group" }
|
|
82
82
|
|
83
83
|
Set parties:
|
84
84
|
|
85
|
-
|
86
|
-
class User < ApplicationRecord
|
87
|
-
belongs_to :group, optional: true
|
88
|
-
has_one :party, as: :partable, class_name: 'Wf::Party'
|
89
|
-
|
90
|
-
# NOTICE: group or user or role all has_many users
|
91
|
-
has_many :users, foreign_key: :id
|
85
|
+
For normal org model, for example group or role etc.
|
92
86
|
|
93
|
-
|
94
|
-
|
87
|
+
```ruby
|
88
|
+
module Wf
|
89
|
+
class Group < ApplicationRecord
|
90
|
+
has_many :users
|
91
|
+
include Wf::ActsAsParty
|
92
|
+
acts_as_party(user: false, party_name: :name)
|
95
93
|
end
|
96
94
|
end
|
97
95
|
```
|
98
96
|
|
97
|
+
For user model:
|
98
|
+
|
99
99
|
```ruby
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
module Wf
|
101
|
+
class User < ApplicationRecord
|
102
|
+
belongs_to :group, optional: true
|
103
|
+
include Wf::ActsAsParty
|
104
|
+
acts_as_party(user: true, party_name: :name)
|
105
105
|
end
|
106
106
|
end
|
107
107
|
```
|
@@ -1,21 +1,23 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
2
4
|
|
3
5
|
module Wf
|
4
6
|
module ActsAsParty
|
5
|
-
|
6
|
-
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
7
9
|
included do
|
8
10
|
has_one :party, as: :partable
|
9
11
|
end
|
10
|
-
|
12
|
+
|
11
13
|
module ClassMethods
|
12
|
-
def acts_as_party(options = {user: false, party_name: :name})
|
14
|
+
def acts_as_party(options = { user: false, party_name: :name })
|
13
15
|
cattr_accessor :yaffle_text_field
|
14
|
-
|
15
|
-
|
16
|
+
has_many :users, foreign_key: :id if options[:user]
|
17
|
+
after_create do
|
16
18
|
create_party(party_name: options[:party_name])
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
21
|
-
end
|
23
|
+
end
|
@@ -17,9 +17,11 @@ module Wf::CaseCommand
|
|
17
17
|
end
|
18
18
|
|
19
19
|
unless has_case_ass
|
20
|
-
|
21
|
-
if
|
22
|
-
|
20
|
+
callback_parties = workitem.transition.assignment_callback.constantize.new.perform(workitem.id)
|
21
|
+
if callback_parties.present?
|
22
|
+
callback_parties.each do |party|
|
23
|
+
AddWorkitemAssignment.call(workitem, party, false)
|
24
|
+
end
|
23
25
|
else
|
24
26
|
workitem.transition.transition_static_assignments.each do |static_assignment|
|
25
27
|
AddWorkitemAssignment.call(workitem, static_assignment.party, false)
|
data/app/models/wf/transition.rb
CHANGED
data/lib/wf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petri_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hooopo Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|