card-mod-carrierwave 0.17.0 → 0.18.1

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: 88a2af21e5caf0c6c695e722cc3a97b27366a0efa2d52f5e13bb1722ec979731
4
- data.tar.gz: cf3f344bd209ddf88b85b4b037660254ab8c82aea5cf0d0138c8f1fa31b40165
3
+ metadata.gz: 73304194a2bb94ad8c34b94efbe6eb25fbc1be4980d47aaec3cb4754f38372b1
4
+ data.tar.gz: 94fc1681758c94e3d81342d64c788571ebfa3115efdd1b930fa96c50d41de7a3
5
5
  SHA512:
6
- metadata.gz: 259779a3dbf7d7bbe4106a9630f2afd8fdcee17bb2283f3f99504e533368d02f534fbd0269708f74dce01c9bc995587faebfc8c682ac7975683e6f29bfedc9ee
7
- data.tar.gz: 71ad7c23e067986dcc1cc6f3f4301f2e87806dc83cab3763dc77658bc029ed570e75fd098cfe3d4418655228419e078dd878cc4050bdaf2fc4a61fec2d33241d
6
+ metadata.gz: 164d1d2db881114ae6b29fe0aa85db12b4ebf1e1a0bac5eb12c7b5eee11f7e8727baea166cc7d856d894b333d16291dcff9d774e9e50e19152679878ca31cdeb
7
+ data.tar.gz: ace22385ed01cb5d8306d66bd26a3e78d1305d930814f2ce9da0d040935be57f73f95312d516789f988f796398e61b65e13ceb6261a9acba9418feaa7dba9bdd
@@ -12,7 +12,10 @@ end
12
12
 
13
13
  # we need a card id for the path so we have to update db_content when we have
14
14
  # an id
15
- event :correct_identifier, :finalize, on: :create, when: proc { |c| !c.web? } do
15
+ event :correct_identifier, :finalize, on: :save, when: proc { |c| !c.web? } do
16
+ correct_id = attachment.db_content
17
+ return if db_content == correct_id
18
+
16
19
  update_column :db_content, attachment.db_content
17
20
  expire
18
21
  end
@@ -20,7 +23,7 @@ end
20
23
  event :save_original_filename, :prepare_to_store, on: :save, when: :file_ready_to_save? do
21
24
  return unless @current_action
22
25
 
23
- @current_action.update! comment: original_filename
26
+ @current_action.comment = original_filename
24
27
  end
25
28
 
26
29
  event :validate_file_exist, :validate, on: :create, skip: :allowed do
@@ -101,10 +104,10 @@ def duplicate?
101
104
  end
102
105
 
103
106
  def delete_files_for_action action
104
- with_selected_action_id(action.id) do
107
+ with_selected_action_id action.id do
105
108
  attachment.file.delete
106
109
  attachment.versions.each_value do |version|
107
- version.file.delete
110
+ version.file&.delete
108
111
  end
109
112
  end
110
113
  end
data/set/type/file.rb CHANGED
@@ -9,15 +9,15 @@ module SelectedAction
9
9
 
10
10
  def last_content_action_id
11
11
  # find action id from content (saves lookups)
12
- db_content.to_s.split(%r{[/.]})[-2]
12
+ aid = db_content.to_s.split(%r{[/.]})[-2]
13
+ aid.number? ? aid.to_i : nil
13
14
  end
14
15
  end
15
16
  include SelectedAction
16
17
 
17
18
  format do
18
19
  view :source do
19
- file = card.attachment
20
- file.valid? ? contextualize_path(file.url) : ""
20
+ source
21
21
  end
22
22
 
23
23
  view :core do
@@ -32,17 +32,22 @@ format do
32
32
 
33
33
  def handle_source
34
34
  rescuing_file_source_error do
35
- source = _render_source
36
- if source.blank?
35
+ src = source
36
+ if src.blank?
37
37
  ""
38
38
  elsif block_given?
39
- yield source
39
+ yield src
40
40
  else
41
- source
41
+ src
42
42
  end
43
43
  end
44
44
  end
45
45
 
46
+ def source
47
+ file = card.attachment
48
+ file.valid? ? contextualize_path(file.url) : ""
49
+ end
50
+
46
51
  def selected_version
47
52
  card.attachment
48
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.1
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-11-22 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.1
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.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: carrierwave
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -88,28 +88,28 @@ dependencies:
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.17.0
91
+ version: 0.18.1
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.17.0
98
+ version: 0.18.1
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: card-mod-permissions
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.17.0
105
+ version: 0.18.1
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.17.0
112
+ version: 0.18.1
113
113
  description: ''
114
114
  email:
115
115
  - info@decko.org
@@ -171,7 +171,7 @@ files:
171
171
  - set/type/image/html_views.rb
172
172
  homepage: https://decko.org
173
173
  licenses:
174
- - GPL-3.0
174
+ - GPL-3.0-or-later
175
175
  metadata:
176
176
  source_code_uri: https://github.com/decko-commons/decko
177
177
  homepage_uri: https://decko.org