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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 602d528be497ee17f65b85f33819e115718cf472
4
- data.tar.gz: 2b72dcc15b90d4f421b189111accbfaf271e9c1c
3
+ metadata.gz: 5ddac12d5db4f24ec3201a07ce325786ca81368a
4
+ data.tar.gz: 67ef80c9c3c7d4d07a14203c29bc739d08b0f576
5
5
  SHA512:
6
- metadata.gz: 379f20347035d2ce06609c9ba140e06b1d992c49d056a8bd752a22812024f4790ae27b2c0d8acf0790bdd4fd6f37b6073154b1345e026037a2994101984bbcd5
7
- data.tar.gz: e84387d92e9a0d62965c147b7dadbb6f15f9ccc3e5f74b6840114e4e9b2893735ca099ef4483bbf4e389f292450566f63384ab3d94bf73fc102f47cdb19d22b5
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
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Action
3
- VERSION = '1.7'.freeze
3
+ VERSION = '1.8'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-action
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.7'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du