effective_bootstrap 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/form_inputs/file_field.rb +12 -2
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ca6a774b911ab73f075f9981ad5f1ebc88a41d00409665e5a0fdd404e7c2d4a
|
4
|
+
data.tar.gz: 2d97baf8f07f894209b679505bfb82e4a3e1b753a321ba0f38f4c5187f822975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3530d0ccd7a0db06f3b5a76dd1158139a0b1b6b638cce635dea5533bcc7cd93f20896868bbd36a9b341e9cf23a0dff8ca1bb4d25bd79608403f635f3734faad9
|
7
|
+
data.tar.gz: 140da48f3f67b3fb1b4fbdacaefad449313b37f1df3a4123e366dce6ae29b20be9ec45db64cccb3f831fb820ed562d7f343705146da43a31d7eff97dc8a7bf2d
|
@@ -5,9 +5,9 @@ module Effective
|
|
5
5
|
def build_input(&block)
|
6
6
|
case attachments_style
|
7
7
|
when :card
|
8
|
-
build_attachments + build_uploads + super
|
8
|
+
build_existing_attachments + build_attachments + build_uploads + super
|
9
9
|
when :table, :ck_assets
|
10
|
-
super + build_uploads + build_attachments
|
10
|
+
super + build_existing_attachments + build_uploads + build_attachments
|
11
11
|
else
|
12
12
|
raise('unsupported attachments_style, try :card or :table')
|
13
13
|
end
|
@@ -32,6 +32,16 @@ module Effective
|
|
32
32
|
super(obj, name) && Array(object.public_send(name)).length == 0
|
33
33
|
end
|
34
34
|
|
35
|
+
def build_existing_attachments
|
36
|
+
return ''.html_safe unless multiple?
|
37
|
+
|
38
|
+
attachments = object.send(name)
|
39
|
+
|
40
|
+
attachments.map.with_index do |attachment, index|
|
41
|
+
@builder.hidden_field(name, multiple: true, id: (tag_id + "_#{index}"), value: attachment.signed_id)
|
42
|
+
end.join.html_safe
|
43
|
+
end
|
44
|
+
|
35
45
|
def build_attachments
|
36
46
|
return ''.html_safe unless object.respond_to?(name) && object.send(name).respond_to?(:attached?) && object.send(name).attached?
|
37
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|