card-mod-carrierwave 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: 88a2af21e5caf0c6c695e722cc3a97b27366a0efa2d52f5e13bb1722ec979731
4
- data.tar.gz: cf3f344bd209ddf88b85b4b037660254ab8c82aea5cf0d0138c8f1fa31b40165
3
+ metadata.gz: af54c8d9b6dd92aa82b0c8c6c4bb628db93f587719f3f32d180186cdaea28b3d
4
+ data.tar.gz: fd615e28d1721b69180c89153088fab1649cda08faca0fc8c8ed82a42d612385
5
5
  SHA512:
6
- metadata.gz: 259779a3dbf7d7bbe4106a9630f2afd8fdcee17bb2283f3f99504e533368d02f534fbd0269708f74dce01c9bc995587faebfc8c682ac7975683e6f29bfedc9ee
7
- data.tar.gz: 71ad7c23e067986dcc1cc6f3f4301f2e87806dc83cab3763dc77658bc029ed570e75fd098cfe3d4418655228419e078dd878cc4050bdaf2fc4a61fec2d33241d
6
+ metadata.gz: 4feb890ba0bbaa2150544e44bbc09295e0cc5acd0c67a910af1fdc10d60bcbfcc24151ab433e09af5178f8a4ed07392b39a04c093e0784aa1679cddb1ab30594
7
+ data.tar.gz: 53ca6ac88541efd2e576661c20f2c4fff8b79cc11990e43b6a2d9872d001e1d5a1e9d4e471e3678997c0aa90a2b94f13455a8765b29a55136f6cb665b16d6ebc
@@ -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.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
  - !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.0
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.0
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.0
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.0
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
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
197
  requirements: []
198
- rubygems_version: 3.5.10
198
+ rubygems_version: 3.5.7
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: File and Image handling