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 +4 -4
- data/set/abstract/attachment.rb +7 -4
- data/set/type/file.rb +12 -7
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73304194a2bb94ad8c34b94efbe6eb25fbc1be4980d47aaec3cb4754f38372b1
|
4
|
+
data.tar.gz: 94fc1681758c94e3d81342d64c788571ebfa3115efdd1b930fa96c50d41de7a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 164d1d2db881114ae6b29fe0aa85db12b4ebf1e1a0bac5eb12c7b5eee11f7e8727baea166cc7d856d894b333d16291dcff9d774e9e50e19152679878ca31cdeb
|
7
|
+
data.tar.gz: ace22385ed01cb5d8306d66bd26a3e78d1305d930814f2ce9da0d040935be57f73f95312d516789f988f796398e61b65e13ceb6261a9acba9418feaa7dba9bdd
|
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.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-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|