unidom-action 1.9.2 → 1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/app/models/unidom/action/obsolescing.rb +3 -0
- data/app/types/unidom/action/obsolescence.rb +7 -0
- data/config/enum.yml +7 -0
- data/config/locales/enum.zh-CN.yml +6 -0
- data/lib/unidom/action/engine.rb +6 -0
- data/lib/unidom/action/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2deaee6276c97fd1733d2451217ed26997735a5
|
4
|
+
data.tar.gz: a0da4cd35a4aba30877b3fc7ff322709d51326a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddbb1bc597148571ff17e4669cc393cc9d5509bc91a68b0618025cd3a5ca425a69b984c4392f65dd5f55f7bcf72830f64ca68aeb6f7916a1a1e32944f3cd1981
|
7
|
+
data.tar.gz: 3b18f7f51e9dd0e76e755fb8269c871a25568f62b3b6c59d98af2fbc1f5d6cebf380caf33ed6df68d4b291f07e4a8828341c0f9bbfa6a8dd8376a9568aa8aa5c
|
data/README.md
CHANGED
@@ -122,3 +122,14 @@ The As State Transitor Party concern do the following tasks for the includer aut
|
|
122
122
|
1. Define the has_many :transited_state_transitions macro as: ``has_many :transited_state_transitions, class_name: 'Unidom::Action::StateTransition', as: :transitor_party``
|
123
123
|
2. Define the #transit! method as: ``transit!(it, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now)``
|
124
124
|
3. Define the #transit? method as: ``transit?(it, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now)``
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
## Enum codes
|
129
|
+
|
130
|
+
### Obsolescence enum code
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
Unidom::Action::Obsolescence::Obsolesce
|
134
|
+
Unidom::Action::Obsolescence::Recover
|
135
|
+
```
|
@@ -8,6 +8,7 @@ class Unidom::Action::Obsolescing < Unidom::Action::ApplicationRecord
|
|
8
8
|
self.table_name = 'unidom_obsolescings'
|
9
9
|
|
10
10
|
include Unidom::Common::Concerns::ModelExtension
|
11
|
+
include ProgneTapera::EnumCode
|
11
12
|
|
12
13
|
belongs_to :obsolescer_visitor, polymorphic: true
|
13
14
|
belongs_to :obsolescer_party, polymorphic: true
|
@@ -19,6 +20,8 @@ class Unidom::Action::Obsolescing < Unidom::Action::ApplicationRecord
|
|
19
20
|
scope :obsolesced_is, ->(obsolesced) { where obsolesced: obsolesced }
|
20
21
|
scope :caused_by, ->(reason) { where reason_id: to_id(reason) }
|
21
22
|
|
23
|
+
code :obsolescence, Unidom::Action::Obsolescence
|
24
|
+
|
22
25
|
def self.obsolesce!(obsolesced: nil, obsolescer_visitor: nil, obsolescer_party: nil, reason: nil, obsolescence_code: 'OBSL', opened_at: Time.now)
|
23
26
|
create! obsolesced: obsolesced, obsolescer_visitor: obsolescer_visitor, obsolescer_party: obsolescer_party, reason: reason, obsolescence_code: obsolescence_code, opened_at: opened_at
|
24
27
|
end
|
data/config/enum.yml
ADDED
data/lib/unidom/action/engine.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'unidom/common/yaml_helper'
|
2
|
+
|
1
3
|
module Unidom
|
2
4
|
module Action
|
3
5
|
|
@@ -5,6 +7,10 @@ module Unidom
|
|
5
7
|
|
6
8
|
isolate_namespace ::Unidom::Action
|
7
9
|
|
10
|
+
initializer :load_config_initializers do |app|
|
11
|
+
Unidom::Common::YamlHelper.load_enum config: app.config, root: config.root
|
12
|
+
end
|
13
|
+
|
8
14
|
initializer :append_migrations do |app|
|
9
15
|
config.paths['db/migrate'].expanded.each { |expanded_path| app.config.paths['db/migrate'] << expanded_path } unless app.root.to_s.match root.to_s
|
10
16
|
end
|
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: 1.
|
4
|
+
version: '1.10'
|
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-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -54,7 +54,10 @@ files:
|
|
54
54
|
- app/models/unidom/action/obsolescing.rb
|
55
55
|
- app/models/unidom/action/reason.rb
|
56
56
|
- app/models/unidom/action/state_transition.rb
|
57
|
+
- app/types/unidom/action/obsolescence.rb
|
57
58
|
- app/views/layouts/unidom/action/application.html.erb
|
59
|
+
- config/enum.yml
|
60
|
+
- config/locales/enum.zh-CN.yml
|
58
61
|
- config/routes.rb
|
59
62
|
- db/migrate/20000501000000_create_unidom_reasons.rb
|
60
63
|
- db/migrate/20000510000000_create_unidom_actings.rb
|