card-mod-carrierwave 0.11.5 → 0.13.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: b3189d4e4979c66b05d69e7b09a602098410d5df3faa5cdd19a96b7b026a69bb
4
- data.tar.gz: 774a0049c1c77d4373d5769a965734b797e916606f8ebd959ed97c39315f5646
3
+ metadata.gz: 8c8f20cc9a7b83ae10932e555f5826a53de1aa4732775b5ccd5625e44efadff1
4
+ data.tar.gz: 8d657cbdc291433776002029114f1408383848b4410367b1bea1c58a12e65fb6
5
5
  SHA512:
6
- metadata.gz: 2091526b0eb3da1d50ec833d7d990848a4bd6968b4595a235debccd6b5d802dcb5b32bf20a2abe6b2d0ba2679ad1d8564c755ea2d06f435563cdb08bf76e46e1
7
- data.tar.gz: d10af461b8cc1ef9d0eaf8147274ab8e40f9a0106f87e8f153ccd2b4884ff73667fc53c6dfab8391f541dd3e80a552b06fc1d3eb03fd42d3174fdbd150653632
6
+ metadata.gz: f949fbdd2be70ff51e834b23b86575fb0bf4bd8363316b23a8c9aa93b7c605913e9e7860d46402e850e6629459db8fedda22510cc5631f4b90eccd4911405d40
7
+ data.tar.gz: 8753dd281fdbd9c0c013a27d1f4281a53c806617f33bda390f00264ec8537c9104f128af16ffe4549685665818e1762c7af596efb9bcd71098f4b8e0a142a8f7
@@ -28,14 +28,17 @@ module CarrierWave
28
28
  on: :delete, when: proc { |c| !c.history? } do
29
29
  remove_#{column}!
30
30
  end
31
+
31
32
  event :mark_remove_#{column}_false_event, :finalize,
32
33
  on: :update do
33
34
  mark_remove_#{column}_false
34
35
  end
36
+
35
37
  event :store_previous_changes_for_#{column}_event, :store,
36
38
  on: :update, when: proc { |c| !c.history? } do
37
39
  store_previous_changes_for_#{column}
38
40
  end
41
+
39
42
  event :remove_previously_stored_#{column}_event, :finalize,
40
43
  on: :update, when: proc { |c| !c.history?} do
41
44
  remove_previously_stored_#{column}
@@ -68,6 +71,7 @@ module CarrierWave
68
71
 
69
72
  def #{column}=(new_file)
70
73
  return if new_file.blank?
74
+ self.selected_action_id = Time.now.to_i unless history?
71
75
  assign_file(new_file) { super }
72
76
  end
73
77
 
@@ -39,7 +39,7 @@ def files_base_dir_configuration_error
39
39
  "missing directory for file cache (default is `files` in deck root)"
40
40
  end
41
41
 
42
- # used in the indentifier
42
+ # used in the identifier
43
43
  def file_dir
44
44
  if coded?
45
45
  ":#{codename}"
@@ -1,4 +1,4 @@
1
- attr_writer :bucket, :storage_type
1
+ attr_writer :bucket, :new_storage_type
2
2
 
3
3
  event :storage_type_change, :store, on: :update, when: :storage_type_changed? do
4
4
  # carrierwave stores file if @cache_id is not nil
data/set/type/file.rb CHANGED
@@ -19,9 +19,7 @@ include SelectedAction
19
19
  format do
20
20
  view :source do
21
21
  file = card.attachment
22
- return "" unless file.valid?
23
-
24
- contextualize_path file.url
22
+ file.valid? ? contextualize_path(file.url) : ""
25
23
  end
26
24
 
27
25
  view :core do
@@ -37,9 +35,13 @@ format do
37
35
  def handle_source
38
36
  rescuing_file_source_error do
39
37
  source = _render_source
40
- return "" if source.blank?
41
-
42
- block_given? ? yield(source) : source
38
+ if source.blank?
39
+ ""
40
+ elsif block_given?
41
+ yield source
42
+ else
43
+ source
44
+ end
43
45
  end
44
46
  end
45
47
 
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.11.5
4
+ version: 0.13.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: 2021-05-10 00:00:00.000000000 Z
13
+ date: 2021-08-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.5
21
+ version: 1.103.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.101.5
28
+ version: 1.103.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: carrierwave
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 2.2.1
35
+ version: '2.2'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 2.2.1
42
+ version: '2.2'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: mini_magick
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -60,28 +60,28 @@ dependencies:
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.11.5
63
+ version: 0.13.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.11.5
70
+ version: 0.13.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: card-mod-permissions
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.11.5
77
+ version: 0.13.0
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.11.5
84
+ version: 0.13.0
85
85
  description: ''
86
86
  email:
87
87
  - info@decko.org
@@ -89,7 +89,6 @@ executables: []
89
89
  extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
- - config/core_initializers/carrierwave.rb
93
92
  - lib/carrier_wave/card_mount.rb
94
93
  - lib/carrier_wave/file_card_uploader.rb
95
94
  - lib/carrier_wave/file_card_uploader/path.rb
@@ -138,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
137
  - !ruby/object:Gem::Version
139
138
  version: '0'
140
139
  requirements: []
141
- rubygems_version: 3.1.4
140
+ rubygems_version: 3.1.6
142
141
  signing_key:
143
142
  specification_version: 4
144
143
  summary: File and Image handling
@@ -1,5 +0,0 @@
1
- require "carrierwave"
2
-
3
- ActiveSupport.on_load :card do
4
- Card.extend CarrierWave::Mount
5
- end