unidom-action 1.14 → 1.15
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 +34 -20
- data/app/models/unidom/action/concerns/as_searcher_party.rb +18 -0
- data/lib/unidom/action/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83ce4fa8f3da91e3a5afa1ac24ea1ba9e917e641
|
|
4
|
+
data.tar.gz: 12249ab8a10d69d22534ba37cfae48c2d7a5768b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7ec58c24e75af51da24113bd7e4653c3c7b60202fd792eec88e429b841dfca0e2a427d39613a3b1b95f0ed1708b21a377a0778cbd0ffe9a9597e77d7026d569
|
|
7
|
+
data.tar.gz: dd8e30c3658b1948a1b0e5ed298a877199808f0c65bdcd8e4be73513423806dce3fb633d4fab96e1cec3a5ac1c06730767d03fa5433fc73393837448d8650ee9
|
data/README.md
CHANGED
|
@@ -105,49 +105,63 @@ include Unidom::Action::Concerns::AsStateTransitorParty
|
|
|
105
105
|
|
|
106
106
|
### As Acted concern
|
|
107
107
|
|
|
108
|
-
The As Acted concern do the following tasks for the includer automatically:
|
|
109
|
-
1. Define the has_many :actings macro as: ``has_many :actings, class_name: 'Unidom::Action::Acting', as: :acted``
|
|
110
|
-
|
|
108
|
+
The As Acted concern do the following tasks for the includer automatically:
|
|
109
|
+
1. Define the has_many :actings macro as: ``has_many :actings, class_name: 'Unidom::Action::Acting', as: :acted``
|
|
110
|
+
|
|
111
|
+
2. Define the #is_acted! method as: ``is_acted!(from: nil, thru: nil, due_to: nil, by: nil, via: nil, at: Time.now, action_code: 'C')``
|
|
112
|
+
|
|
111
113
|
3. Define the #is_acted? method as: ``is_acted?(due_to: nil, by: nil, via: nil, at: Time.now, action_code: 'C')``
|
|
112
114
|
|
|
113
115
|
### As Actor Party concern
|
|
114
116
|
|
|
115
|
-
The As Actor Party concern do the following tasks for the includer automatically:
|
|
116
|
-
1. Define the has_many :acted_actings macro as: ``has_many :acted_actings, class_name: 'Unidom::Action::Acting', as: :actor_party``
|
|
117
|
-
|
|
117
|
+
The As Actor Party concern do the following tasks for the includer automatically:
|
|
118
|
+
1. Define the has_many :acted_actings macro as: ``has_many :acted_actings, class_name: 'Unidom::Action::Acting', as: :actor_party``
|
|
119
|
+
|
|
120
|
+
2. Define the #act! method as: ``act!(on: nil, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now, action_code: 'C')``
|
|
121
|
+
|
|
118
122
|
3. Define the #act? method as: ``act?(on: nil, due_to: nil, via: nil, at: Time.now, action_code: 'C')``
|
|
119
123
|
|
|
120
124
|
### As Obsolesced concern
|
|
121
125
|
|
|
122
|
-
The As Obsolesced concern do the following tasks for the includer automatically:
|
|
123
|
-
1. Define the has_many :obsolescings macro as: ``has_many :obsolescings, class_name: 'Unidom::Action::Obsolescing', as: :obsolesced``
|
|
124
|
-
|
|
126
|
+
The As Obsolesced concern do the following tasks for the includer automatically:
|
|
127
|
+
1. Define the has_many :obsolescings macro as: ``has_many :obsolescings, class_name: 'Unidom::Action::Obsolescing', as: :obsolesced``
|
|
128
|
+
|
|
129
|
+
2. Define the #is_obsolesced! method as: ``is_obsolesced!(obsolescence_code: 'OBSL', due_to: nil, via: nil, by: nil, at: Time.now)``
|
|
130
|
+
|
|
125
131
|
3. Define the #is_obsolesced? method as: ``is_obsolesced?(obsolescence_code: 'OBSL', due_to: nil, via: nil, by: nil, at: Time.now)``
|
|
126
132
|
|
|
127
133
|
### As Obsolescer Party concern
|
|
128
134
|
|
|
129
|
-
The As Obsolescer Party concern do the following tasks for the includer automatically:
|
|
130
|
-
1. Define the has_many :obsolesced_obsolescings macro as: ``has_many :obsolesced_obsolescings, class_name: 'Unidom::Action::Obsolescing', as: :obsolescer_party``
|
|
131
|
-
|
|
135
|
+
The As Obsolescer Party concern do the following tasks for the includer automatically:
|
|
136
|
+
1. Define the has_many :obsolesced_obsolescings macro as: ``has_many :obsolesced_obsolescings, class_name: 'Unidom::Action::Obsolescing', as: :obsolescer_party``
|
|
137
|
+
|
|
138
|
+
2. Define the #obsolesce! method as: ``obsolesce!(it, obsolescence_code: 'OBSL', due_to: nil, via: nil, at: Time.now)``
|
|
139
|
+
|
|
132
140
|
3. Define the #obsolesce? method as: ``obsolesce?(it, obsolescence_code: 'OBSL', due_to: nil, via: nil, at: Time.now)``
|
|
133
141
|
|
|
134
142
|
### As Searcher Party concern
|
|
135
143
|
|
|
136
|
-
The As Searcher Party concern do the following tasks for the includer automatically:
|
|
137
|
-
1. Define the has_many :searched_searchings macro as: ``has_many :searched_searchings, class_name: 'Unidom::Action::Searching', as: :searcher_party``
|
|
144
|
+
The As Searcher Party concern do the following tasks for the includer automatically:
|
|
145
|
+
1. Define the has_many :searched_searchings macro as: ``has_many :searched_searchings, class_name: 'Unidom::Action::Searching', as: :searcher_party``
|
|
146
|
+
|
|
147
|
+
2. Define the #search! method as: ``search!(it, on: '', version: '1', per: {}, due_to: nil, via: nil, at: Time.now, displaying: 0, of_total: 0, on_current_page: 0, of_total_page: 0, per_page: 0)``
|
|
138
148
|
|
|
139
149
|
### As State Subject concern
|
|
140
150
|
|
|
141
|
-
The As State Subject concern do the following tasks for the includer automatically:
|
|
142
|
-
1. Define the has_many :state_transitions macro as: ``has_many :state_transitions, class_name: 'Unidom::Action::StateTransition', as: :subject``
|
|
143
|
-
|
|
151
|
+
The As State Subject concern do the following tasks for the includer automatically:
|
|
152
|
+
1. Define the has_many :state_transitions macro as: ``has_many :state_transitions, class_name: 'Unidom::Action::StateTransition', as: :subject``
|
|
153
|
+
|
|
154
|
+
2. Define the #is_transited! method as: ``is_transited!(from: nil, thru: nil, due_to: nil, via: nil, by: nil, at: Time.now)``
|
|
155
|
+
|
|
144
156
|
3. Define the #is_transited? method as: ``is_transited?(from: nil, thru: nil, due_to: nil, via: nil, by: nil, at: Time.now)``
|
|
145
157
|
|
|
146
158
|
### As State Transitor Party concern
|
|
147
159
|
|
|
148
|
-
The As State Transitor Party concern do the following tasks for the includer automatically:
|
|
149
|
-
1. Define the has_many :transited_state_transitions macro as: ``has_many :transited_state_transitions, class_name: 'Unidom::Action::StateTransition', as: :transitor_party``
|
|
150
|
-
|
|
160
|
+
The As State Transitor Party concern do the following tasks for the includer automatically:
|
|
161
|
+
1. Define the has_many :transited_state_transitions macro as: ``has_many :transited_state_transitions, class_name: 'Unidom::Action::StateTransition', as: :transitor_party``
|
|
162
|
+
|
|
163
|
+
2. Define the #transit! method as: ``transit!(it, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now)``
|
|
164
|
+
|
|
151
165
|
3. Define the #transit? method as: ``transit?(it, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now)``
|
|
152
166
|
|
|
153
167
|
|
|
@@ -6,6 +6,24 @@ module Unidom::Action::Concerns::AsSearcherParty
|
|
|
6
6
|
|
|
7
7
|
has_many :searched_searchings, class_name: 'Unidom::Action::Searching', as: :searcher_party
|
|
8
8
|
|
|
9
|
+
def search!(it, on: '', version: '1', per: {}, due_to: nil, via: nil, at: Time.now, displaying: 0, of_total: 0, on_current_page: 0, of_total_page: 0, per_page: 0)
|
|
10
|
+
searched_searchings.create! resource_name: it, platform_name: on, platform_version: version, criteria: per,
|
|
11
|
+
reason: due_to, searcher_visitor: via, opened_at: at,
|
|
12
|
+
shown_count: displaying, found_count: of_total, current_page: on_current_page, total_pages: of_total_page, per_page: per_page
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
=begin
|
|
16
|
+
def search?(it, on: '', version: '1', due_to: nil, at: Time.now)
|
|
17
|
+
query = searched_searchings
|
|
18
|
+
query = query.resource_name_is it if it.present?
|
|
19
|
+
query = query.platform_name_is on if on.present?
|
|
20
|
+
query = query.platform_version_is version if version.present?
|
|
21
|
+
query = query.caused_by due_to if due_to.present?
|
|
22
|
+
query = query.valid_at now: at if at.present?
|
|
23
|
+
query.alive.exists?
|
|
24
|
+
end
|
|
25
|
+
=end
|
|
26
|
+
|
|
9
27
|
end
|
|
10
28
|
|
|
11
29
|
module ClassMethods
|
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.15'
|
|
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-12-
|
|
11
|
+
date: 2016-12-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|