petri_flow 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/wf/acts_as_party.rb +21 -0
- data/app/models/wf/group.rb +2 -4
- data/app/models/wf/user.rb +2 -8
- data/lib/wf/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d03bca56fe4145b890fd88b727e78ee433f8876fdcd2d08e3f8e2d20b053329
|
4
|
+
data.tar.gz: 47482a3b0c6f1f9220761487be443a99604ecf159de349ec0f131d65a8e05c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a97e0072c3ebf3aabcb165dc5fd176240ea76eaf393fca8489e7ff7497b0bfed442eb59aa161e56e7f82f73eecfaed397582acea55892abc73671be20eb4790
|
7
|
+
data.tar.gz: 6b24bda1541f835f9b89e6fa72fac5c52a03238bdee7ac67f4816128aa670712533a05d83f99d2f7c06616b5dc0919b6d6b59fa396d16b0600c471295aec7824
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
3
|
+
module Wf
|
4
|
+
module ActsAsParty
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
has_one :party, as: :partable
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
def acts_as_party(options = {user: false, party_name: :name})
|
13
|
+
cattr_accessor :yaffle_text_field
|
14
|
+
self.has_many :users, foreign_key: :id if options[:user]
|
15
|
+
self.after_create do
|
16
|
+
create_party(party_name: options[:party_name])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/app/models/wf/group.rb
CHANGED
data/app/models/wf/user.rb
CHANGED
@@ -14,13 +14,7 @@
|
|
14
14
|
module Wf
|
15
15
|
class User < ApplicationRecord
|
16
16
|
belongs_to :group, optional: true
|
17
|
-
|
18
|
-
|
19
|
-
# NOTICE: group or user or role all has_many users
|
20
|
-
has_many :users, foreign_key: :id
|
21
|
-
|
22
|
-
after_create do
|
23
|
-
create_party(party_name: name)
|
24
|
-
end
|
17
|
+
include Wf::ActsAsParty
|
18
|
+
acts_as_party(user: true, party_name: :name)
|
25
19
|
end
|
26
20
|
end
|
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.3
|
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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|
@@ -246,6 +246,7 @@ files:
|
|
246
246
|
- app/jobs/wf/application_job.rb
|
247
247
|
- app/jobs/wf/fire_timed_workitem_job.rb
|
248
248
|
- app/mailers/wf/application_mailer.rb
|
249
|
+
- app/models/wf/acts_as_party.rb
|
249
250
|
- app/models/wf/application_record.rb
|
250
251
|
- app/models/wf/arc.rb
|
251
252
|
- app/models/wf/callbacks/assignment_default.rb
|