unidom-action 1.7 → 1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/models/unidom/action/concerns/as_actor_party.rb +16 -0
- data/lib/unidom/action/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ddac12d5db4f24ec3201a07ce325786ca81368a
|
4
|
+
data.tar.gz: 67ef80c9c3c7d4d07a14203c29bc739d08b0f576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4cf12a3b6e6b8d311a9ccc7d308ae35a9f2bb6a8fd88cbd6639d34077b9a12a6db4a5a7f17ccf56bbc5513067306379652d41d43ff9699a8fcc071da97548ff
|
7
|
+
data.tar.gz: 667004f4946bf7d9be24f812edaf1b61edcc03b861eb877fa73b84b5b1b60499da3ea3b6fb6754086abd242a2175fcf2c7629528a1c07e50288e2272c28c1c7d
|
data/README.md
CHANGED
@@ -92,6 +92,7 @@ The As Acted concern do the following tasks for the includer automatically:
|
|
92
92
|
|
93
93
|
The As Actor Party concern do the following tasks for the includer automatically:
|
94
94
|
1. Define the has_many :acted_actings macro as: ``has_many :acted_actings, class_name: 'Unidom::Action::Acting', as: :actor_party``
|
95
|
+
2. Define the #act! method as: ``act!(on: nil, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now, action_code: 'C')``
|
95
96
|
|
96
97
|
### As Obsolesced concern
|
97
98
|
|
@@ -6,6 +6,22 @@ module Unidom::Action::Concerns::AsActorParty
|
|
6
6
|
|
7
7
|
has_many :acted_actings, class_name: 'Unidom::Action::Acting', as: :actor_party
|
8
8
|
|
9
|
+
def act!(on: nil, from: nil, thru: nil, due_to: nil, via: nil, at: Time.now, action_code: 'C')
|
10
|
+
acted_actings.create! acted: on, from_value: from, thru_value: thru, reason: due_to, actor_visitor: via, opened_at: at, action_code: action_code
|
11
|
+
end
|
12
|
+
|
13
|
+
=begin
|
14
|
+
def act?(on: nil, due_to: nil, via: nil, at: Time.now, action_code: 'C')
|
15
|
+
query = acted_actings
|
16
|
+
query = query.acted_is on if on.present?
|
17
|
+
query = query.acted_via via if via.present?
|
18
|
+
query = query.action_coded_as action_code if action_code.present?
|
19
|
+
query = query.valid_at now: at if at.present?
|
20
|
+
query = query.caused_by due_to if due_to.present?
|
21
|
+
query.alive.exists?
|
22
|
+
end
|
23
|
+
=end
|
24
|
+
|
9
25
|
end
|
10
26
|
|
11
27
|
module ClassMethods
|