unidom-action 0.3 → 0.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 +4 -4
- data/README.md +10 -0
- data/app/models/unidom/action/concerns/as_state_subject.rb +14 -0
- data/app/models/unidom/action/{obsolescence.rb → obsolescing.rb} +4 -3
- data/db/migrate/{20000512000000_create_unidom_obsolescences.rb → 20000512000000_create_unidom_obsolescings.rb} +8 -6
- data/lib/unidom/action/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8304dab4d4d76575eeaa456eaf56c4a84e68810
|
|
4
|
+
data.tar.gz: 7e3d94fd5860a7c2b9dbe43230f8d0767c54754e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 884cc42787b35880f9b792683be097bc38bafe9b982a7c080a950f70dd841b1f45721232cd3bc96638848777a41f88c00609b755b8d8d2a3e2f4d25336cd9fd3
|
|
7
|
+
data.tar.gz: 6b2983632f465bebdbf97230bf4b343acc44cf6bda450a0899c82c21ff341be7d77e5e4ead18d6eaf2f6d48d135df71600bde226a831c97f35cabec6f04917ba
|
data/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](http://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://badge.fury.io/rb/unidom-action)
|
|
5
|
+
[](https://gemnasium.com/github.com/topbitdu/unidom-action)
|
|
5
6
|
|
|
6
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.
|
|
7
8
|
Unidom (统一领域对象模型)是一系列的领域模型引擎。审计领域模型引擎包括原因、状态迁移、废弃和行为日志的模型。
|
|
@@ -42,3 +43,12 @@ person.soft_destroy
|
|
|
42
43
|
obsolescence = Unidom::Action::Obsolescence.create! obsolescer_visitor: user, obsolescer_party: person, reason: reason, obsolesced: person
|
|
43
44
|
# The reason could be nil.
|
|
44
45
|
```
|
|
46
|
+
|
|
47
|
+
## Include the Concern
|
|
48
|
+
```ruby
|
|
49
|
+
include Unidom::Action::Concerns::AsStateSubject
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### As State Subject concern
|
|
53
|
+
The As State Subject concern do the following tasks for the includer automatically:
|
|
54
|
+
1. Define the has_many :state_transitions macro as: ``has_many :state_transitions, class_name: 'Unidom::Action::StateTransition', as: :subject``
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Obsolescing 是废弃。
|
|
2
2
|
# #reason 是原因。
|
|
3
3
|
# #obsolesced 是被废弃的对象。
|
|
4
|
+
# #obsolescence_code 是废弃代码,OBSL 表示废弃, RCVR 表示恢复。
|
|
4
5
|
|
|
5
|
-
class Unidom::Action::
|
|
6
|
+
class Unidom::Action::Obsolescing < Unidom::Action::ApplicationRecord
|
|
6
7
|
|
|
7
|
-
self.table_name = '
|
|
8
|
+
self.table_name = 'unidom_obsolescings'
|
|
8
9
|
|
|
9
10
|
include Unidom::Common::Concerns::ModelExtension
|
|
10
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
class
|
|
1
|
+
class CreateUnidomObsolescings < ActiveRecord::Migration
|
|
2
2
|
|
|
3
3
|
def change
|
|
4
4
|
|
|
5
|
-
create_table :
|
|
5
|
+
create_table :unidom_obsolescings, id: :uuid do |t|
|
|
6
6
|
|
|
7
7
|
t.references :obsolescer_visitor, type: :uuid, null: false,
|
|
8
8
|
polymorphic: { null: false, default: '', limit: 200 }
|
|
@@ -12,6 +12,8 @@ class CreateUnidomObsolescences < ActiveRecord::Migration
|
|
|
12
12
|
polymorphic: { null: false, default: '', limit: 200 }
|
|
13
13
|
t.references :reason, type: :uuid, null: true
|
|
14
14
|
|
|
15
|
+
t.column :obsolescence_code, 'char(4)', null: false, default: 'OBSL'
|
|
16
|
+
|
|
15
17
|
t.column :state, 'char(1)', null: false, default: 'C'
|
|
16
18
|
t.datetime :opened_at, null: false, default: Time.utc(1970)
|
|
17
19
|
t.datetime :closed_at, null: false, default: Time.utc(3000)
|
|
@@ -22,10 +24,10 @@ class CreateUnidomObsolescences < ActiveRecord::Migration
|
|
|
22
24
|
|
|
23
25
|
end
|
|
24
26
|
|
|
25
|
-
add_index :
|
|
26
|
-
add_index :
|
|
27
|
-
add_index :
|
|
28
|
-
add_index :
|
|
27
|
+
add_index :unidom_obsolescings, :obsolescer_visitor_id
|
|
28
|
+
add_index :unidom_obsolescings, :obsolescer_party_id
|
|
29
|
+
add_index :unidom_obsolescings, :obsolesced_id
|
|
30
|
+
add_index :unidom_obsolescings, :reason_id
|
|
29
31
|
|
|
30
32
|
end
|
|
31
33
|
|
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.4'
|
|
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-
|
|
11
|
+
date: 2016-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|
|
@@ -45,7 +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/
|
|
48
|
+
- app/models/unidom/action/concerns/as_state_subject.rb
|
|
49
|
+
- app/models/unidom/action/obsolescing.rb
|
|
49
50
|
- app/models/unidom/action/reason.rb
|
|
50
51
|
- app/models/unidom/action/state_transition.rb
|
|
51
52
|
- app/views/layouts/unidom/action/application.html.erb
|
|
@@ -53,7 +54,7 @@ files:
|
|
|
53
54
|
- db/migrate/20000501000000_create_unidom_reasons.rb
|
|
54
55
|
- db/migrate/20000510000000_create_unidom_actings.rb
|
|
55
56
|
- db/migrate/20000511000000_create_unidom_state_transitions.rb
|
|
56
|
-
- db/migrate/
|
|
57
|
+
- db/migrate/20000512000000_create_unidom_obsolescings.rb
|
|
57
58
|
- lib/tasks/action_tasks.rake
|
|
58
59
|
- lib/unidom/action.rb
|
|
59
60
|
- lib/unidom/action/engine.rb
|