unidom-action 0.4 → 0.5
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 +28 -0
- data/app/models/unidom/action/concerns/as_acted.rb +14 -0
- data/app/models/unidom/action/concerns/as_obsolesced.rb +14 -0
- data/lib/unidom/action/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c5fb32cd1d3c846164bc08a7114405f0f85d6b9
|
|
4
|
+
data.tar.gz: cf7518c92df11c04be521281f47e75a09b0d6cc8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e30143137d04a9424551ba5284d309a42459caa3770849213f7cc2afbf0c6bde85ec99dca2abb1a7fac0158b58c7af1c97c9ad1f9df959870383d39d1db98a2e
|
|
7
|
+
data.tar.gz: 4219ebbfb62322733de9bca73b6d7c9a9533902022d378180b6ce11e7c41034474f529929ac6bcd08335af6dcc062f9fcd770d9b5eca56b8e7dad9078d8ad2fa
|
data/README.md
CHANGED
|
@@ -7,22 +7,34 @@
|
|
|
7
7
|
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Action domain model engine includes the Reason, State Transition, Obsolescene, and the Acting models.
|
|
8
8
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。审计领域模型引擎包括原因、状态迁移、废弃和行为日志的模型。
|
|
9
9
|
|
|
10
|
+
|
|
11
|
+
|
|
10
12
|
## Recent Update
|
|
13
|
+
|
|
11
14
|
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
|
12
15
|
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
|
13
16
|
|
|
17
|
+
|
|
18
|
+
|
|
14
19
|
## Usage in Gemfile
|
|
20
|
+
|
|
15
21
|
```ruby
|
|
16
22
|
gem 'unidom-action'
|
|
17
23
|
```
|
|
18
24
|
|
|
25
|
+
|
|
26
|
+
|
|
19
27
|
## Run the Database Migration
|
|
28
|
+
|
|
20
29
|
```shell
|
|
21
30
|
rake db:migrate
|
|
22
31
|
```
|
|
23
32
|
The migration versions start with 200005.
|
|
24
33
|
|
|
34
|
+
|
|
35
|
+
|
|
25
36
|
## Call the Model
|
|
37
|
+
|
|
26
38
|
```ruby
|
|
27
39
|
reason = Unidom::Action::Reason.create! activity_code: 'SRRR', name: 'broken', description: 'The box was broken.'
|
|
28
40
|
# SRRR = Shipment Receipt Rejection Reason
|
|
@@ -44,11 +56,27 @@ obsolescence = Unidom::Action::Obsolescence.create! obsolescer_visitor: user, ob
|
|
|
44
56
|
# The reason could be nil.
|
|
45
57
|
```
|
|
46
58
|
|
|
59
|
+
|
|
60
|
+
|
|
47
61
|
## Include the Concern
|
|
62
|
+
|
|
48
63
|
```ruby
|
|
64
|
+
include Unidom::Action::Concerns::AsActed
|
|
65
|
+
include Unidom::Action::Concerns::AsObsolesced
|
|
49
66
|
include Unidom::Action::Concerns::AsStateSubject
|
|
50
67
|
```
|
|
51
68
|
|
|
69
|
+
### As Acted concern
|
|
70
|
+
|
|
71
|
+
The As Acted concern do the following tasks for the includer automatically:
|
|
72
|
+
1. Define the has_many :actings macro as: ``has_many :actings, class_name: 'Unidom::Action::Acting', as: :acted``
|
|
73
|
+
|
|
74
|
+
### As Obsolesced concern
|
|
75
|
+
|
|
76
|
+
The As Obsolesced concern do the following tasks for the includer automatically:
|
|
77
|
+
1. Define the has_many :obsolescings macro as: ``has_many :obsolescings, class_name: 'Unidom::Action::Obsolescing', as: :obsolesced``
|
|
78
|
+
|
|
52
79
|
### As State Subject concern
|
|
80
|
+
|
|
53
81
|
The As State Subject concern do the following tasks for the includer automatically:
|
|
54
82
|
1. Define the has_many :state_transitions macro as: ``has_many :state_transitions, class_name: 'Unidom::Action::StateTransition', as: :subject``
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unidom-action
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '0.
|
|
4
|
+
version: '0.5'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Topbit Du
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-10-
|
|
11
|
+
date: 2016-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|
|
@@ -45,6 +45,8 @@ files:
|
|
|
45
45
|
- app/mailers/unidom/action/application_mailer.rb
|
|
46
46
|
- app/models/unidom/action/acting.rb
|
|
47
47
|
- app/models/unidom/action/application_record.rb
|
|
48
|
+
- app/models/unidom/action/concerns/as_acted.rb
|
|
49
|
+
- app/models/unidom/action/concerns/as_obsolesced.rb
|
|
48
50
|
- app/models/unidom/action/concerns/as_state_subject.rb
|
|
49
51
|
- app/models/unidom/action/obsolescing.rb
|
|
50
52
|
- app/models/unidom/action/reason.rb
|