card-mod-history 0.17.0 → 0.18.0

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
  SHA256:
3
- metadata.gz: ef26bb3f54e291b305c04d313dc3f5718606a2f447af31ec01594e950545a64e
4
- data.tar.gz: 3edd2f398f989a2b1a22989f60103bd9fd1307f13ef1d248e8db66a4ff058f8a
3
+ metadata.gz: 1a20f2d9eec3fe3db61fd2812e78f4bb8565cda58e0b1fc7a0688c8cb5765109
4
+ data.tar.gz: 7be6fe76ba77beee613bc340de7177403c98caf3e818d15f8b58a70b4d67fa37
5
5
  SHA512:
6
- metadata.gz: 0e4c06ce4757f5c61351538ee99c2763bd1f9e15285f4046dd4a4060bc8fd3d5116c06abbd3b8e6542754885dd58ec7734b5fa81343e9a0191b92e5d0969be22
7
- data.tar.gz: 7686879a8ac1ff5be965861c48b134c373d32e123a6c880247d2a5bbdad8580884d9aefcdbea7d615a2e414d905b9d4da2c25c57000646aef42ae13a177a1eb3
6
+ metadata.gz: cb259274b48f051e5e793142d26efe926eb1fcb66d0204586f8d459c99b0d1307538683ff8936a84969ccbdef56daa8ddf3cc0a9f22e3754de0ded3328878c48
7
+ data.tar.gz: d1c77b5e3e5db4f7788d1e985986d0fcf4d1caf0005201e66a0ac949b560e059834aac159b71ea6e9806e275121595b696441bbb14d0fab2b0cfe677b36005b6
@@ -107,8 +107,7 @@ class Card
107
107
  "#{time_ago_in_words(@act.acted_at)} ago"
108
108
  end
109
109
 
110
- def
111
- accordion_item
110
+ def accordion_item
112
111
  # context = @act.main_action&.draft ? :warning : :default
113
112
  @format.accordion_item header,
114
113
  subheader: act_links,
@@ -102,11 +102,9 @@ class Card
102
102
  # @return [True/False] for :trash
103
103
  def interpret_value field, value
104
104
  case field.to_sym
105
- when :type_id
106
- value&.to_i
107
- when :cardtype
108
- Card.fetch_name(value&.to_i)
109
- else value
105
+ when :type_id then value&.to_i
106
+ when :cardtype then value&.to_i&.cardname
107
+ else value
110
108
  end
111
109
  end
112
110
  end
data/lib/card/action.rb CHANGED
@@ -31,8 +31,8 @@ class Card
31
31
  inverse_of: :action,
32
32
  dependent: :delete_all,
33
33
  class_name: "Card::Change"
34
- belongs_to :super_action, class_name: "Action", inverse_of: :sub_actions
35
- has_many :sub_actions, class_name: "Action", inverse_of: :super_action
34
+ belongs_to :super_action, class_name: "Card::Action", inverse_of: :sub_actions
35
+ has_many :sub_actions, class_name: "Card::Action", inverse_of: :super_action
36
36
 
37
37
  scope :created_by, lambda { |actor_id|
38
38
  joins(:act).where "card_acts.actor_id = ?", actor_id
@@ -6,18 +6,14 @@ event :update_ancestor_timestamps, :integrate do
6
6
  ids.map { |anc_id| Card.expire anc_id.cardname }
7
7
  end
8
8
 
9
+ # event :update_temporary_cache, :initialize do
10
+ # Card.cache.temp.write key, self if key.present?
11
+ # end
12
+
9
13
  # must be called on all actions and before :set_name, :process_subcards and
10
14
  # :delete_children
11
15
  event :assign_action, :initialize, when: :actionable? do
12
- act = director.need_act
13
- @current_action = Card::Action.create(
14
- card_act_id: act.id,
15
- action_type: action,
16
- draft: (Env.params["draft"] == "true")
17
- )
18
- if @supercard && @supercard != self
19
- @current_action.super_action = @supercard.current_action
20
- end
16
+ @current_action = new_action
21
17
  end
22
18
 
23
19
  event :detect_conflict, :validate, on: :update, when: :edit_conflict? do
@@ -53,12 +49,6 @@ event :finalize_act, after: :finalize_action, when: :act_card? do
53
49
  Card::Director.act.update! card_id: id
54
50
  end
55
51
 
56
- event :remove_empty_act, :integrate_with_delay_final,
57
- priority: 100, when: :remove_empty_act? do
58
- # Card::Director.act.delete
59
- # Card::Director.act = nil
60
- end
61
-
62
52
  # can we store an action? (can be overridden, eg in files)
63
53
  def actionable?
64
54
  history?
@@ -81,6 +71,26 @@ end
81
71
 
82
72
  private
83
73
 
74
+ def new_action
75
+ Card::Action.new(
76
+ act: director.need_act,
77
+ # ar_card: self,
78
+ action_type: action,
79
+ draft: draft_action?,
80
+ super_action: super_action
81
+ )
82
+ end
83
+
84
+ def draft_action?
85
+ Env.params["draft"] == "true"
86
+ end
87
+
88
+ def super_action
89
+ return unless @supercard && @supercard != self
90
+
91
+ @supercard.current_action
92
+ end
93
+
84
94
  # changes for the create action are stored after the first update
85
95
  def store_card_changes_for_create_action
86
96
  Card::Action.cache.delete "#{create_action.id}-changes"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-history
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-06-12 00:00:00.000000000 Z
13
+ date: 2024-10-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.107.0
21
+ version: 1.108.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.107.0
28
+ version: 1.108.0
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org
@@ -65,7 +65,7 @@ files:
65
65
  - set/all/history_board.rb
66
66
  homepage: https://decko.org
67
67
  licenses:
68
- - GPL-3.0
68
+ - GPL-3.0-or-later
69
69
  metadata:
70
70
  source_code_uri: https://github.com/decko-commons/decko
71
71
  homepage_uri: https://decko.org
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.5.10
92
+ rubygems_version: 3.5.7
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Revision histories in acts, actions, and changes