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 +4 -4
- data/set/abstract/attachment.rb +7 -4
- data/set/type/file.rb +12 -7
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af54c8d9b6dd92aa82b0c8c6c4bb628db93f587719f3f32d180186cdaea28b3d
|
4
|
+
data.tar.gz: fd615e28d1721b69180c89153088fab1649cda08faca0fc8c8ed82a42d612385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4feb890ba0bbaa2150544e44bbc09295e0cc5acd0c67a910af1fdc10d60bcbfcc24151ab433e09af5178f8a4ed07392b39a04c093e0784aa1679cddb1ab30594
|
7
|
+
data.tar.gz: 53ca6ac88541efd2e576661c20f2c4fff8b79cc11990e43b6a2d9872d001e1d5a1e9d4e471e3678997c0aa90a2b94f13455a8765b29a55136f6cb665b16d6ebc
|
data/set/abstract/attachment.rb
CHANGED
@@ -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: :
|
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.
|
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
|
107
|
+
with_selected_action_id action.id do
|
105
108
|
attachment.file.delete
|
106
109
|
attachment.versions.each_value do |version|
|
107
|
-
version.file
|
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
|
-
|
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
|
-
|
36
|
-
if
|
35
|
+
src = source
|
36
|
+
if src.blank?
|
37
37
|
""
|
38
38
|
elsif block_given?
|
39
|
-
yield
|
39
|
+
yield src
|
40
40
|
else
|
41
|
-
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
198
|
+
rubygems_version: 3.5.7
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: File and Image handling
|