simple_form_bs5_file_input 0.1.3 → 0.1.5

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: e3e8fedf5f192642394251e54de774c6eee4a3d0bd8aaf1743fe5764fdd08894
4
- data.tar.gz: bcf4c4237b630ea3eda4c0aaa469e5f555c85c1003e5580272df34d77460989d
3
+ metadata.gz: ad8dbe0e29be34622a8767dca8b66316620a6e9a5a6985b6e86ead4870ba091f
4
+ data.tar.gz: fc700a40263bf7629edd4440d4584f44b68d617bf0bc30c936675329cab3e463
5
5
  SHA512:
6
- metadata.gz: f72252369cf36f53ac1f5380e3140aff36e0bcc11bef09ab2f2bfc3442916d2eb48e307ecc148ca8e186fea587120009326137e8980f666b3c35a79fb8535ae8
7
- data.tar.gz: f83dd485981568672cde5863750ef4623df3e5d729f9dc4af9a1b7c06fba4ce84187cae5481c003341a727f57b41f9e4ab9fe8fce55cd89a59db68b60085a257
6
+ metadata.gz: dbcf837fbfba01fa6a9d71c50cc56faa5ebb9dcef779e2d2e30fda386d49bf3679b99c8b16b5b3aeb4c8b07d6da44c6268ca2b9b86f1ecb58d7ca28db2d25218
7
+ data.tar.gz: c2da275020ade136903d0302e433d02a452336e28ded46fec43b5187006805747ebef3c269e73b7522adc9636275f48bc5292b04d92721ab6c806d0177d7d57c
data/Gemfile.lock CHANGED
@@ -1,77 +1,78 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_bs5_file_input (0.1.2)
4
+ simple_form_bs5_file_input (0.1.4)
5
5
  rails
6
6
  simple_form
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (7.1.1)
12
- actionpack (= 7.1.1)
13
- activesupport (= 7.1.1)
11
+ actioncable (7.1.3.2)
12
+ actionpack (= 7.1.3.2)
13
+ activesupport (= 7.1.3.2)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (>= 0.6.1)
16
16
  zeitwerk (~> 2.6)
17
- actionmailbox (7.1.1)
18
- actionpack (= 7.1.1)
19
- activejob (= 7.1.1)
20
- activerecord (= 7.1.1)
21
- activestorage (= 7.1.1)
22
- activesupport (= 7.1.1)
17
+ actionmailbox (7.1.3.2)
18
+ actionpack (= 7.1.3.2)
19
+ activejob (= 7.1.3.2)
20
+ activerecord (= 7.1.3.2)
21
+ activestorage (= 7.1.3.2)
22
+ activesupport (= 7.1.3.2)
23
23
  mail (>= 2.7.1)
24
24
  net-imap
25
25
  net-pop
26
26
  net-smtp
27
- actionmailer (7.1.1)
28
- actionpack (= 7.1.1)
29
- actionview (= 7.1.1)
30
- activejob (= 7.1.1)
31
- activesupport (= 7.1.1)
27
+ actionmailer (7.1.3.2)
28
+ actionpack (= 7.1.3.2)
29
+ actionview (= 7.1.3.2)
30
+ activejob (= 7.1.3.2)
31
+ activesupport (= 7.1.3.2)
32
32
  mail (~> 2.5, >= 2.5.4)
33
33
  net-imap
34
34
  net-pop
35
35
  net-smtp
36
36
  rails-dom-testing (~> 2.2)
37
- actionpack (7.1.1)
38
- actionview (= 7.1.1)
39
- activesupport (= 7.1.1)
37
+ actionpack (7.1.3.2)
38
+ actionview (= 7.1.3.2)
39
+ activesupport (= 7.1.3.2)
40
40
  nokogiri (>= 1.8.5)
41
+ racc
41
42
  rack (>= 2.2.4)
42
43
  rack-session (>= 1.0.1)
43
44
  rack-test (>= 0.6.3)
44
45
  rails-dom-testing (~> 2.2)
45
46
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.1)
47
- actionpack (= 7.1.1)
48
- activerecord (= 7.1.1)
49
- activestorage (= 7.1.1)
50
- activesupport (= 7.1.1)
47
+ actiontext (7.1.3.2)
48
+ actionpack (= 7.1.3.2)
49
+ activerecord (= 7.1.3.2)
50
+ activestorage (= 7.1.3.2)
51
+ activesupport (= 7.1.3.2)
51
52
  globalid (>= 0.6.0)
52
53
  nokogiri (>= 1.8.5)
53
- actionview (7.1.1)
54
- activesupport (= 7.1.1)
54
+ actionview (7.1.3.2)
55
+ activesupport (= 7.1.3.2)
55
56
  builder (~> 3.1)
56
57
  erubi (~> 1.11)
57
58
  rails-dom-testing (~> 2.2)
58
59
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.1)
60
- activesupport (= 7.1.1)
60
+ activejob (7.1.3.2)
61
+ activesupport (= 7.1.3.2)
61
62
  globalid (>= 0.3.6)
62
- activemodel (7.1.1)
63
- activesupport (= 7.1.1)
64
- activerecord (7.1.1)
65
- activemodel (= 7.1.1)
66
- activesupport (= 7.1.1)
63
+ activemodel (7.1.3.2)
64
+ activesupport (= 7.1.3.2)
65
+ activerecord (7.1.3.2)
66
+ activemodel (= 7.1.3.2)
67
+ activesupport (= 7.1.3.2)
67
68
  timeout (>= 0.4.0)
68
- activestorage (7.1.1)
69
- actionpack (= 7.1.1)
70
- activejob (= 7.1.1)
71
- activerecord (= 7.1.1)
72
- activesupport (= 7.1.1)
69
+ activestorage (7.1.3.2)
70
+ actionpack (= 7.1.3.2)
71
+ activejob (= 7.1.3.2)
72
+ activerecord (= 7.1.3.2)
73
+ activesupport (= 7.1.3.2)
73
74
  marcel (~> 1.0)
74
- activesupport (7.1.1)
75
+ activesupport (7.1.3.2)
75
76
  base64
76
77
  bigdecimal
77
78
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -81,49 +82,47 @@ GEM
81
82
  minitest (>= 5.1)
82
83
  mutex_m
83
84
  tzinfo (~> 2.0)
84
- autoprefixer-rails (10.4.15.0)
85
+ autoprefixer-rails (10.4.16.0)
85
86
  execjs (~> 2)
86
- base64 (0.1.1)
87
- bcrypt (3.1.19)
88
- bigdecimal (3.1.4)
89
- bootsnap (1.16.0)
87
+ base64 (0.2.0)
88
+ bcrypt (3.1.20)
89
+ bigdecimal (3.1.7)
90
+ bootsnap (1.18.3)
90
91
  msgpack (~> 1.2)
91
- bootstrap (5.3.1)
92
+ bootstrap (5.3.2)
92
93
  autoprefixer-rails (>= 9.1.0)
93
94
  popper_js (>= 2.11.8, < 3)
94
- sassc-rails (>= 2.0.0)
95
95
  builder (3.2.4)
96
- concurrent-ruby (1.2.2)
96
+ concurrent-ruby (1.2.3)
97
97
  connection_pool (2.4.1)
98
98
  crass (1.0.6)
99
- date (3.3.3)
99
+ date (3.3.4)
100
100
  devise (4.9.3)
101
101
  bcrypt (~> 3.0)
102
102
  orm_adapter (~> 0.1)
103
103
  railties (>= 4.1.0)
104
104
  responders
105
105
  warden (~> 1.2.3)
106
- drb (2.1.1)
107
- ruby2_keywords
106
+ drb (2.2.1)
108
107
  erubi (1.12.0)
109
108
  execjs (2.9.1)
110
109
  ffi (1.16.3)
111
110
  globalid (1.2.1)
112
111
  activesupport (>= 6.1)
113
- i18n (1.14.1)
112
+ i18n (1.14.4)
114
113
  concurrent-ruby (~> 1.0)
115
- io-console (0.6.0)
116
- irb (1.8.1)
114
+ io-console (0.7.2)
115
+ irb (1.12.0)
117
116
  rdoc
118
- reline (>= 0.3.8)
117
+ reline (>= 0.4.2)
119
118
  jquery-rails (4.6.0)
120
119
  rails-dom-testing (>= 1, < 3)
121
120
  railties (>= 4.2.0)
122
121
  thor (>= 0.14, < 2.0)
123
- listen (3.8.0)
122
+ listen (3.9.0)
124
123
  rb-fsevent (~> 0.10, >= 0.10.3)
125
124
  rb-inotify (~> 0.9, >= 0.9.10)
126
- loofah (2.21.4)
125
+ loofah (2.22.0)
127
126
  crass (~> 1.0.2)
128
127
  nokogiri (>= 1.12.0)
129
128
  mail (2.8.1)
@@ -131,32 +130,32 @@ GEM
131
130
  net-imap
132
131
  net-pop
133
132
  net-smtp
134
- marcel (1.0.2)
133
+ marcel (1.0.4)
135
134
  mini_mime (1.1.5)
136
- mini_portile2 (2.8.4)
137
- minitest (5.20.0)
135
+ mini_portile2 (2.8.5)
136
+ minitest (5.22.3)
138
137
  msgpack (1.7.2)
139
- mutex_m (0.1.2)
140
- net-imap (0.4.1)
138
+ mutex_m (0.2.0)
139
+ net-imap (0.4.10)
141
140
  date
142
141
  net-protocol
143
142
  net-pop (0.1.2)
144
143
  net-protocol
145
- net-protocol (0.2.1)
144
+ net-protocol (0.2.2)
146
145
  timeout
147
- net-smtp (0.4.0)
146
+ net-smtp (0.4.0.1)
148
147
  net-protocol
149
- nio4r (2.5.9)
150
- nokogiri (1.15.4)
148
+ nio4r (2.7.0)
149
+ nokogiri (1.16.2)
151
150
  mini_portile2 (~> 2.8.2)
152
151
  racc (~> 1.4)
153
152
  orm_adapter (0.5.0)
154
- pg (1.5.4)
153
+ pg (1.5.6)
155
154
  popper_js (2.11.8)
156
- psych (5.1.1)
155
+ psych (5.1.2)
157
156
  stringio
158
- racc (1.7.1)
159
- rack (3.0.8)
157
+ racc (1.7.3)
158
+ rack (3.0.9.1)
160
159
  rack-session (2.0.0)
161
160
  rack (>= 3.0.0)
162
161
  rack-test (2.1.0)
@@ -164,20 +163,20 @@ GEM
164
163
  rackup (2.1.0)
165
164
  rack (>= 3)
166
165
  webrick (~> 1.8)
167
- rails (7.1.1)
168
- actioncable (= 7.1.1)
169
- actionmailbox (= 7.1.1)
170
- actionmailer (= 7.1.1)
171
- actionpack (= 7.1.1)
172
- actiontext (= 7.1.1)
173
- actionview (= 7.1.1)
174
- activejob (= 7.1.1)
175
- activemodel (= 7.1.1)
176
- activerecord (= 7.1.1)
177
- activestorage (= 7.1.1)
178
- activesupport (= 7.1.1)
166
+ rails (7.1.3.2)
167
+ actioncable (= 7.1.3.2)
168
+ actionmailbox (= 7.1.3.2)
169
+ actionmailer (= 7.1.3.2)
170
+ actionpack (= 7.1.3.2)
171
+ actiontext (= 7.1.3.2)
172
+ actionview (= 7.1.3.2)
173
+ activejob (= 7.1.3.2)
174
+ activemodel (= 7.1.3.2)
175
+ activerecord (= 7.1.3.2)
176
+ activestorage (= 7.1.3.2)
177
+ activesupport (= 7.1.3.2)
179
178
  bundler (>= 1.15.0)
180
- railties (= 7.1.1)
179
+ railties (= 7.1.3.2)
181
180
  rails-dom-testing (2.2.0)
182
181
  activesupport (>= 5.0.0)
183
182
  minitest
@@ -185,50 +184,33 @@ GEM
185
184
  rails-html-sanitizer (1.6.0)
186
185
  loofah (~> 2.21)
187
186
  nokogiri (~> 1.14)
188
- railties (7.1.1)
189
- actionpack (= 7.1.1)
190
- activesupport (= 7.1.1)
187
+ railties (7.1.3.2)
188
+ actionpack (= 7.1.3.2)
189
+ activesupport (= 7.1.3.2)
191
190
  irb
192
191
  rackup (>= 1.0.0)
193
192
  rake (>= 12.2)
194
193
  thor (~> 1.0, >= 1.2.2)
195
194
  zeitwerk (~> 2.6)
196
- rake (13.0.6)
195
+ rake (13.1.0)
197
196
  rb-fsevent (0.11.2)
198
197
  rb-inotify (0.10.1)
199
198
  ffi (~> 1.0)
200
- rdoc (6.5.0)
199
+ rdoc (6.6.2)
201
200
  psych (>= 4.0.0)
202
- reline (0.3.9)
201
+ reline (0.4.3)
203
202
  io-console (~> 0.5)
204
203
  responders (3.1.1)
205
204
  actionpack (>= 5.2)
206
205
  railties (>= 5.2)
207
- ruby2_keywords (0.0.5)
208
- sassc (2.4.0)
209
- ffi (~> 1.9)
210
- sassc-rails (2.1.2)
211
- railties (>= 4.0.0)
212
- sassc (>= 2.0)
213
- sprockets (> 3.0)
214
- sprockets-rails
215
- tilt
216
206
  simple_form (5.3.0)
217
207
  actionpack (>= 5.2)
218
208
  activemodel (>= 5.2)
219
- sprockets (4.2.1)
220
- concurrent-ruby (~> 1.0)
221
- rack (>= 2.2.4, < 4)
222
- sprockets-rails (3.4.2)
223
- actionpack (>= 5.2)
224
- activesupport (>= 5.2)
225
- sprockets (>= 3.0.0)
226
- sqlite3 (1.6.7)
209
+ sqlite3 (1.7.2)
227
210
  mini_portile2 (~> 2.8.0)
228
- stringio (3.0.8)
229
- thor (1.2.2)
230
- tilt (2.3.0)
231
- timeout (0.4.0)
211
+ stringio (3.1.0)
212
+ thor (1.3.1)
213
+ timeout (0.4.1)
232
214
  tzinfo (2.0.6)
233
215
  concurrent-ruby (~> 1.0)
234
216
  warden (1.2.9)
@@ -237,7 +219,7 @@ GEM
237
219
  websocket-driver (0.7.6)
238
220
  websocket-extensions (>= 0.1.0)
239
221
  websocket-extensions (0.1.5)
240
- zeitwerk (2.6.12)
222
+ zeitwerk (2.6.13)
241
223
 
242
224
  PLATFORMS
243
225
  ruby
@@ -1,11 +1,26 @@
1
1
  class ActiveRecord::Base
2
2
  def self.has_one_attached_deletable(name, **options, &block)
3
+
3
4
  class_eval do
4
5
  attr_accessor :"#{name}_delete"
5
6
  attr_accessor :"#{name}_infos"
6
7
 
7
8
  before_validation { send(name).purge_later if send("#{name}_attachment").present? && send("#{name}_delete") == 'true' }
8
- after_commit :"resize_#{name}", unless: Proc.new { |u| u.send("#{name}_infos").blank? }
9
+
10
+ # From Rails 7.1, after_commit callbacks run in the same order they were defined.
11
+ # Prior to this version, they ran in reverse order.
12
+ after_commit_callbacks_run_in_order = Rails
13
+ .application
14
+ .config
15
+ .active_record
16
+ .try(:run_after_transaction_callbacks_in_order_defined)
17
+ if after_commit_callbacks_run_in_order
18
+ has_one_attached name, **options, &block
19
+ after_commit :"resize_#{name}", unless: Proc.new { |u| u.send("#{name}_infos").blank? }
20
+ else
21
+ after_commit :"resize_#{name}", unless: Proc.new { |u| u.send("#{name}_infos").blank? }
22
+ has_one_attached name, **options, &block
23
+ end
9
24
 
10
25
  define_method :"#{name}_delete=" do |value|
11
26
  instance_variable_set :"@#{name}_delete", value
@@ -52,7 +67,5 @@ class ActiveRecord::Base
52
67
  end
53
68
  end
54
69
  end
55
-
56
- has_one_attached name, **options, &block
57
70
  end
58
71
  end
@@ -113,7 +113,7 @@ class SingleDeletableFileInput < SimpleForm::Inputs::Base
113
113
  end
114
114
 
115
115
  def should_display_file?
116
- file_attachment.present?
116
+ file_attachment.present? && file_attachment.blob&.persisted?
117
117
  end
118
118
 
119
119
  def preview_image_width
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBs5FileInput
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.1.5".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_bs5_file_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-andré Boissinot
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2024-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -94,7 +94,7 @@ homepage: https://github.com/noesya/simple_form_bs5_file_input
94
94
  licenses:
95
95
  - MIT
96
96
  metadata: {}
97
- post_install_message:
97
+ post_install_message:
98
98
  rdoc_options: []
99
99
  require_paths:
100
100
  - lib
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubygems_version: 3.1.4
113
- signing_key:
113
+ signing_key:
114
114
  specification_version: 4
115
115
  summary: Simple Form BS5 File Input
116
116
  test_files: []